I get it, you have your guard up because you have a tough past. Me too. I can be skeptical of others and be really cautious with my feelings too. It doesn't count as an excuse to be a terrible person in what you say or do though.
There is never a good excuse. Just be nice.
Now, I'm not saying you have to be nice every second of everyday. Sometimes there are some people that just bring out your inner mean girl because they're awful. I get that, but try to be the bigger person. I know that's way easier said than done, but it builds your character.
Do not stoop down to their level because it doesn't harm anyone except yourself.
I've been there and I more than anyone understand the urge to outdo somebody. It's not worth it. I can genuinely say being the bigger person has not only worked in my favor in many situations lately, but it's created a lot less drama for myself.
Some people will test you to try and get your dark side to show, it's up to you to be the bigger person.
It's not easy, you're going to want to give in to childish behavior. Just don't. It's not worth it.
I promise you being the bigger person and killing people with kindness will always work.