Yeah this is a huge fear of mine, I tend to freeze in scary situations. Also I fear not realising what's going on until it's too late.
I'd recommend going over self defence techniques over and over until it comes naturally to you, that way you don't need to think you can just let muscle memory do its work. Essentially anyone who comes too close for comfort (after you express discomfort and show what your barrier is) has negative intent (why else would they want to make you uncomfortable?) An easy test is to bring your hands up to your face (like you're avoiding a kiss from someone gross lol) and take a step back, he should pull back and be apologetic if he's in any way a decent human being who understands basic social queues. So immediately be wary once that invasion of your space happens and start mentally prepping yourself for what's about to happen, don't let yourself ever be alone with a person like that, lock yourself in the ladies bathroom if you need to (you never know the strength of female comradery until you've sought help from a bunch of drunk girls in the ladies bathroom of a club…seriously bless those girls), start arranging how to get home (call a taxi to be waiting for you), have someone on the phone…
Once his mood changes (generally assholes will go from sweet and charming to insane in a few seconds) fucking run ASAP because you only have those few seconds before it gets physical. Pick up something heavy to hit him with if you can descretly (a bottle, a vase, your handbag, a phone…whatever is near). Trust your INSTINCTS, the human brain is trained to know what anger looks like (look at his eyebrows, his fists, if he's bending his knees to stabilise himself before a punch/grab).
I'm not saying that rapists/attackers are intelligent but instinctively they go for people who they consider weak (there are videos online of people describing their perfect targets, I'll post if I can find them again) so essentially girls who are small, seem shy, wear heels they can't run in, stray from their friends often, are careless with their drinks, look like they are too shy to scream…I'm not saying that you should be constantly on edge while out (that would ruin your night and give you anxiety!) But if he's expecting you to be quiet and not fight back, you have to do the opposite. In those few seconds I mentioned before he attacks when his personality changes, you have the opurtunity to scare the shit out of him (scream, slap him in the face, stomp on his foot, throw something at him…even pretend you heard him say something vulgar to use as an excuse lol) and then RUN. You'll never get in trouble for doing any of those things and running.
Then if you're in a desperate situation and it does escalate, you'll be prepared to protect your body no matter what happens. Your chin will automatically bend down to protect your trachea if you feel a choke happening, you'll automatically raise your knees to protect your vital organs, you'll automatically bring your hands to your face to be ready for a fight.
You'll be fine once you've prepped yourself, anon. Most people I know who have dealt with these situations say thay everything feels like it's in slow motion and your instincts kick in (run if you're able to and be ready to protect yourself if needed). They say that they get an out of body experience and they're surprised at what they managed to achieve in those few seconds.
You're stronger than you think :)