It’s strange, but the first couple of times I’ve gone out, I somehow instinctively was more aware and had my keys at the ready as I left the place where I was hanging out to go to my car parked on the street. And it was in sight of the door in a well-trafficked and (relatively) safe area.
I didn’t have to think about it, it just sort of kicked in. When I dress and go out, I actually have a shift in mind-state, it feels like. Everything goes into girl-mode. I drive more sanely, er cautiously (giggle), and look around me before entering or exiting my car, etc. I walk, stand, sit as a female without having to remind myself things like posture, thighs together, loose shoulders.
I have no idea how I’ll respond in a situation like you had, but unless I’m about to have an “accident” I’m going on the next place!