Sounds horrible. I hope you remember that what she says, she says. She is digging her own dirt and all her negative comments reflect her mind - a mind making up reasons to put another person down in front of others.
Sometimes honest criticism is needed, but her behavior, mocking and shaming you publicly, rather than discussing what she has on her mind directly with you when she has the opportunity, highlights the sole bullying nature of her behavior.
So try not to take it to your heart. I know, easier said than done...
Like you said, maybe you could tell your side of the story, but not to put her down equally, but to show that in this real life, at the receiving end, there is a real person with feelings. A person who can get hurt and whose life can take a sad turn based on choices other people make.
These "accidents" could be prevented by keeping just that one thing in mind.
All the best.