Bah, this is one of those tricky situations where there´s no easy answer.
Sure we are taught to never hit a woman, it´s not manly, chivalresque, nice, whatever, but the problem is that that standard of behaviour was created in different times, when women themselves had different standards of behaviour and would never pull that kind of sh1t. Now they do it because they know they can, society is tolerant towards it, and then the cherry on top of the cake is that they benefit from an infamous double standard, they can pull that kind of sh1t but still expect to be treated as "ladies".
Thats just ****ed up, basically, men nowadays are getting deeper and deeper into uncharted territory. They are still expected to abide by the old rules by some women, while at the same time lots of women are throwing that in the trash and trying to rewrite them so that they can have their cake and eat too, and they´re having a ball watching us scratch our heads while they do it.
And if by some reason you do lose it and hit a woman you'll face all sorts of consequences, from the shaming to legal problems. Even if you are just defending yourself from some crazy b1tch you´re more likely to get in trouble than her, you can even have bystanders getting in your face.
So, overall I think the OP dealt with the situation pretty well, he just had some bad luck and had a close encounter of the third kind with some major psycho b1tch, and thats never easy.