I must admit at the time I was very aroused, but I told her it wouldn't be right. Throughout the night she continued bugging me about it until I finally did it. Afterward, I felt sick because not only was she my cousin, but she was also a lot younger. Did I do something terribly wrong?
I know some people would disagree, but I think as long as your cousin really wanted you to do it, and as long as there was no physical contact between you, the incident was probably relatively harmless. The thing about the age differential (and 13 to 17 is a fairly large differential) has to do with an imbalance of power, which in your case was magnified considerably by the gender difference. But from your description, you were absolutely not leading the action – she was. Still, it was healthy for you to feel concerned afterwards about what happened.
Some people would say this was a form of sexual abuse simply because of your ages and genders (not to mention the blood relationship). But in my opinion, like so many things in life, you can't make decisions about complicated situations using a couple of rigid criteria about age, gender, etc. And because laws tend to be rigid and fairly simplistic, many otherwise innocent, healthy, knows-right-from-wrong people get into trouble with the law. There simply isn't a two- or three-variable formula you can use to accurately determine which actions are right and which are wrong in every case. At the same time, though, you should never use this argument to justify wrong actions in progress. For instance, if you're interested in masturbating in front of a much younger person, start to do it, and then ask the person if it's okay that you continue, just because the younger person says "yes" doesn't mean it's okay. He or she may not feel comfortable telling the truth, because of the power imbalance. But if they're following you around for an hour begging you to masturbate for them, that's something else. They made the decision and took all the action, not you. In my opinion there's a big difference.
Still, some people would argue that minors are incapable of making such decisions, simply on account of their age. I happen to disagree. Laws are in place to protect youths, and in most cases they work well at effectively delineating between right and wrong – at least as well as most laws do – and therefore the law should be respected. In your case, since I don't know the laws of the part of the world in which you live, I can't comment on the legality of your situation. But if you're seeking the true, subtle differences between "kinda right" and "kinda wrong," you need to look at each individual situation, with all the variables in play, much more carefully.