I always try and shake his hand right away, as soon as you see her recognise him or at least right after they hug (if they didn't hug don't even sweat it just introduce yourself and wait for her to brush him off)
There are a few ways on how to react, NEVER WALK AWAY/NEVER BITCH ABOUT HIM AFTER HE LEAVES(unless she does this about other people before he comes over) I prefer these two options -
Introduce yourself, and something like "I take it you know [Name]" after he answers, he'll talk to her as soon as she answers and there is a pause. Just say "it was nice to meet you" and "we'll meet you on the dance floor later" or something similar. He'll just excuse himself, you look like a gentleman and convey a protective nature.
**Also works in reverse if you bump into someone and they are talking to another guy, Introduce yourself to her, then to him and just continue talking to her don't ever look away from her and then excuse yourself to him, and then a drifting handshake for her**
__________________________________
if she doesn't introduce you assert yourself and shake his hand/high five whatever, ask him who he's here with and just dominate the conversation. After a while he'll just leave or invite you over, politely decline and say "it was a pleasure" then turn to her "he was nice, so anyway, where were we."
If he's being a dick just point it out, "wow sorry mate but just as [Name] was proving there was nice people you brought rude score right back" etc sometimes he'll correct himself "eerr sorry pal Hi I'm blah blah" you come off as a suave mature person and he comes off as a twat. If he gets violent or starts kicking off literally just stand away and ask her "are these your friends?" rather condescending, she will calm the situation down and even if she does walk away with him. She WILL find you just to apologise
If a guy negs you just call him up on it, "sorry didn't realise this was a primary school disco"
What I hate most of all is when people ignore you, I just keep asking the same question louder and to this day no one has ever just walked away in ignorance. Not like screaming loud but make it obvious you are there.
Hope this helps!