Wow, this has to be the first time I've ever actually disagreed with kre8or, but having grown up around the thug life I have to say don't get a fucking tazer. These guys are petty criminals that seem like they would do what's neccisary to pull off what they want, and probably hooked on the same shit that they're slinging. Which is also probably why they held you up for the $20. Walking a different route home isn't a good idea because these guys rule an area that I'm sure your house is within reach from any direction. The problem with a gun or tazer is that you still have to take the time to pull it out. These guys would definitely have the time to move out of the way, and you could only shoot one at a time. Plus, with a tazer the barbs hook into the person so you're stuck after shocking the first perp. And in that time the other guys are more than likely to be all over you.
Self-defense classes are an alright idea, but that's only if you're not really in danger at the time and you want to learn to defend yourself in the future. Real life is not a Karate Kid movie where you can go through just a few weeks of training and be ready to take on the world. It takes at least a couple years with having a proper attitude, to learn how to have the proper discipline to defend yourself in a situation with multiple opponents. Take it from me, I've been studying martial arts for the last 17 years, I do have a little experience in what it takes. Calling the cops is usually not a good idea either, simply because of the fact that it will spell nothing but retaliation from the other gang members for you and your family.
Walking home with friends of yours isn't a good idea, because then it would seem to the gangsters that you are looking for a rumble and then there could be twenty of them and not just three. The only proper thing you could do in this situation is to talk with your parents, and ask them not to really not get involved in the situation but to see if they could in any way possible give you a ride home during that time frame. And if that's not possible, then I'm sure you have friends that either ride home with their parents or have their own car. You could ask them if it's cool if you ride with them for a little while until things seem safe for you.
I have a feeling that it may not happen again. More than likely these guys had to get an extra $20 to their superiors so then they wouldn't get caught skimming off the top, so it seems like it could have been anyone that got held up like that... not just you. But you can't be 100% sure so take a little advice from me and ask your parents or one of your friends for a ride home for a little while. I'm sure it all will work out for the better.