I'm not sure if it can be learned, but read authors with witty styles. Oscar Wilde comes to mind. Essays by Mark Twain are good. Any prose that expresses a sharp mind and good use of language will help you learn how quick thinking and word-play works.
Since the question pre-supposes some neat little boxes like "queer" and "straight" inside which people live out their lives according to unexamined assumptions about sex and sexuality, I assume those who use these terms about themselves and others think and live inside narrow little boxes in...