Don't react.
Have a calm demeanor.
The more you react (emotions, facial expressions, body language) the more effect he feels he has on you.
Simply say "Hi! How you doin'?" Hold out you hand for him to shake it.
See, when he comes in out of nowhere with you already there, he is trying to "Frame" the environment so that YOU look like the socially awkward, and incongruent person. Meaning, he is trying to reframe the situation so that it looks out of the Social "norm". So that you look awkward, and out of place in your actions.
Avoid the reframe and encourage social norm, and that is, extend a friendly hand shake, and greet the (L)AMOG with courtesy, thereby FORCING him to accept or reject. Thus, rendering him powerless in the reframe, and making HIM look socially inept and awkward, and you look like the "Classy" guy.
If he accepts, simply apologize and let him know you didn't know she was attached. Don't make it awkward and say stuff like "Well, she was giving me eye contact!! And sending me signals!!" That's not classy. You know how women want to guard their reputation.
So introduce yourself, and shake his hand, give the woman a nice compliment and leave with grace, respect, and dignity.
There's no reason to apologize for being attracted to women, and approaching women. But if she's taken, then acknowledge it and move on to someone else.
Now, if he doesn't accept your handshake and attempts at civility, then you take over his frame, you have neutralized it and have made him look likt the awkward, inept guy.
Simply look at the woman, shrug your shoulders ,and give her a look like "I'm sorry you have to deal with this guy!" And split.