Sounds like you did fine. I have such a hard time with this stuff - the rational, reasonable, mature part of my brain knows that there is no win in arguing or fighting. They're not going to change their minds and what are you going to get out of a confrontation other than stress? If you yell or confront, you've immediately put them (and yourself) in fight or flight mode - you aren't teaching anything.
The part of my brain that usually takes over is more aggressive and is offended by crappy behavior. This part of my brain wants justice and cries for action. I've gotten increasingly better at ignoring this part of my psyche, but I'm still firmly of the opinion that a large number of people are in need of a good swift kick to the head.