You handled that well. I, unfortunately, suffer from a certain automatic response when a complete stranger decides to yell at me. It involves the raising of a finger and certain nasty words pouring out of my mouth before the rational part of me kicks in and tells me not to give them the satisfaction.
Good on you.