You were right to break up with her. Painful as it was for you both. She's destructive, she held you back. It's not accident that the happiest and most productive period of your life was that short window between the time you left her and when you took her back.
The great mistake was to respond with so much compassion and alarm to her terrible breakdown that you surrendered your own life while trying to help with hers. No-one deserves that kind of loyalty, ever, under any circumstances.
She took advantage of that generosity, and when she felt she didn't need it anymore she threw you away, in a manner calculated to be as hurtful as possible. When she did it she was proud of herself: gloating, vicious. "Evil" is the word she used, her friends and her. "He's so evil." Admiring tones.
No-one deserves that kind of loyalty. Loyalty that causes you to lose yourself. It doesn't matter who they are, what your feelings are, what you believe they mean to you. If nothing else it isn't practical. Once you've lost your self you're no longer able to help anyone else.