Just thinking off the top of my head, I would would search the customer order table to see it the item about to be displayed on the catalog page, is in that customer's order history. Then on the catalog page, do an If statement:
If found
display download button
else
display purchase button
Each button would link to a different page.