OP, I think you did a great job. In the past I had experience working with men who considered
insulting/patronizing comments teasing to be work-banter. I would secretly seethe but I wished I had done what you did. I also find it really unattractive and offensive when men insult/degrade woman as a form of flirting, it reminds me of those weird pickup artist shows where the pickup artist instructs the students to "lower the woman's self-esteem" before asking her out.
Also, since I don't know your coworker I can't say for sure, but most of the people that I have encountered in my life who like to "joke" with others by being insulting tend to react quite poorly when the tables are turned. I had a manager one summer during undergrad that was pretty insulting to everyone at work, especially the younger female staff, but always claim it was "just a joke" if people got upset and then he would get very stern when others made jokes at his expense.
Hopefully he learns from this and doesn't treat other new coworkers that way.