You took too long to escalate your friend saw that an took advantage of it its messed up he did what he did, but then he's only human and obviously not that good of a friend stealing your girl.
You asked the question "should i have gone outside with them"
Seems like you already kinda knew your friend was going to try and make his move on the girl when he isolated her from you.
he showed some clear signs of wanting your target earlier by wanting to --dance(or excuse to rub his junk on her).
Yeah u should have went outside and pull him off to the side and let him know your trying to get with the girl he would have had no choice but to back off her then at least in front of you. It was part of his plan for you to Not come outside... Learn some strategy to make the flow of things benefit you. because your "friend" outsmarted you that time
as for how you're talking to women running scripted routines and get all frustrated when they fail. There's no need for frustrations
just take a look at this link
read the article about public speaking
i-have-no-fear-of-approach-vt25782.html