I won’t judge what it is you were trying to do and I can’t take an issue with how you handled the situation once you knew you were scammed. It’s pretty clear that you had nothing but good intentions getting involved with this guy. I personally wouldn’t do something like this, but I can see what you were trying to accomplish both for yourself and the guy who turned out to be a scammer.

You did miss a major red flag though imho. You never want to get involved in other debts a person may have. If the person you are dealing with is saying “pay this guy I owe him” right off the bat, something’s definitely rotten in Denmark. You are trying to help the guy out and already he’s telling you to settle the debt with another guy for him. In the end it’s not a big deal we’re not talking about huge money. Certainly you didn’t do anything improper.