I think you did the exactly the right thing. First by thinking of your hostess, secondly once you had worked out who he was by not biting his head off and thirdly staying to when you intended to.
I am not sure I could have been so composed.
If by chance you do meet him again, I 'd be cordial and say hello then turn to someone you do like and talk and laugh with them. That jerk is inconsequential.
(((Chuck)))
Just one more person chiming in here to agree with all that has been said. I know it's late, but I just got back and am catching up on this blog.
Above all, Chuck, you honored your friend (the hostess) by behaving with civility and being respectful (outwardly, anyway, whatever you were thinking on the inside) toward someone she thought enough of that she had invited him to the party. You handled the situation with grace, I'd say. For some reason I'm thinking of someone who has become a great leader: president-elect Obama. He heard some pretty bad things said about him by hateful people this year, yet he always came across as cool and collected, and didn't lash out in return. It's to be admired that you could do that, too.
If I were in your position, I would not have made a scene either, but I might be tempted to have a word privately with the hostess the next time I saw her and say "Oh, by the way, remember that man at the Halloween party? We used to work together and......." But that would depend on your relationship with her; how easily can you confide in her? I still wouldn't want to hurt her feelings, so if there was any doubt about how she would react, the best thing would probably be to let the matter drop and just keep your distance from him if you encounter him at another function.