What you said has several layers of ugliness in my view. I point them out analytically, without judging, because we all make silly mistakes in the heat of the moment, and your question shows (perhaps) an intention to correct yourself and become a better person, and because karma is a ***** and spreading this kind of stuff around could fire back at you at some moment.
1) Lack of empathy and sense of opportunity. Ever heard the sentence "praise in public but criticize in private"? You don't point out someone's faults in public. It's an awful thing to do, be them real or not. It's coward and ugly and nothing constructive will ever come out of it. Only grudge and fear.
2) Being insensible towards other people's suffering. If you had simply said to the guy something like "you're a social loser", it would be bad enough. But, to make things worse, for the sake of looking "witty", you've used a comparison that makes a joke of a horrible human situation. A situation in which people were for many years enslaved, killed and tortured (sometimes even burnt alive). There are lots of other comparisons that you could have used that would have been lighthearted and would have made everybody laugh, together. But making such a gross comparison, is beyond bad taste. Imagine someone in your family had been killed by a group of fanatics (choose any of the many we've had to suffer through history), and someone makes a joke about it. Hate and bigotry are unfortunately very real; don't make a caricature of this stuff.
Add to that the use of the n word, which, afaik, is used in a demeaning way by those prejudiced against black colored humans, and, well, it doesn't get uglier than that. Try to put your quick responses and wit at the service of better causes next time, if you can...