Ya you fucked up, but it doesn't mean that you cant recoup. You can always come back. You never fucked up bad enough.
First of all, unless this bitch was a super freak, you weren't going to make it much further with her friend in the bed next to you. You made it pretty far as it is, and thats fine. Your move should have been to grope and cuddle a little bit here and there. I would have danced around her underwear line or even outside of her pants for a bit. That way you still turn her on without progressing too quickly. You do this for a little while and then you whisper in her ear, "i'm gonna go sleep on the couch (or wherever other people aren't), you should come with me."
What to do now: Text her and be like, "wow, it's a good thing X(what ever the other chicks name is) was sleeping in the bed with us... it felt like you were going to take advantage of me

." then carry on to ask her to hang out again and make it happen when you guys are alone. You have to isolate man.