If I've read your post correctly the girl in question was right there when you said this?
Firstly, I'd say your friend put both you and the girl in an awkward position here. Do you have any idea what his intentions were?
But also, yes, I think your response could have been a bit more considerate towards the girl. Be a gentleman. Even if neither of you are interested in the other, I think the best way to respond to that would be a self-deprecating response, let her save face. Otherwise you just made a girl feel bad about herself for no real reason.
But I appreciate that in the moment, the better response isn't always the first one to leave our mouths. Wouldn't hurt to find the girl at a quiet moment and apologise. Tell her you didn't mean to be insulting, you just panicked. That's what I'd do.
_________________
Listen big boy, now that I've got you made, goodness but I'm afraid, somethings going to happen to you...