I've been doing a little research on the psychology of insults and on the witty elements behind it (maybe I'm a nerd for doing that), and I recently found an interesting book on this topic:
A Slap in the Face: Why Insults Hurt -- And Why They Shouldn't
A Slap in the Face: Why Insults Hurt -- And Why They Shouldn't