Is it possible to create a similar "capture" program that simply captures and returns the btc back to the sender, along with some sort of message that can be used to flag the transaction? This way, over time, it will be easier to determine the source of the code.
This can be done. Great idea.
It can be done but can be abuse by some scammers if this feature will be made. It's like paypal, even if your transaction is legit the sender may open a ticket or dispute about the transaction. So this feature is still not advisable. Before, I was also wondering if we can get back the btc we sent, but now Im understanding well why it cannot be done.