My SO’s co parent regularly attacks me (verbally, mostly through unsolicited texts and emails).
Ugh. I'm so sorry you are exposed to that.
I usually do not respond to anything that is insulting or non- constructive (and have stated that on several occasions).
That's a wise first step

Your instinct is to take care of yourself and that's an important piece when you have a BPD sufferer in your life.
How do you feel about not responding at all? Unfortunately, with BPD, getting a response (any kind of response) can be the whole point. Negative engagement can validate that you are in the ring. Even when we say "I'm not doing this," we're still in the ring.
Do you feel it's an option to not respond to her texts? How would blocking her feel?
Lately her attacks have been more frequent (typically triggered by stress or conflict around the kids). She has accused me of not creating a safe environment for her kids and being creepy (for giving valentine gifts). I am fearing that she is “creating evidence” for a more serious attack (custody, character slander, worse?).
To her, it appears the verbal attacks are not working as a way to eliminate you. So yes, it's possible she may escalate things. Has she made false allegations in the past that you know of? Or is there a history of sexual abuse that your SO might know of?
Any advice on how to best handle is much appreciated. It takes up a lot of my mind space.
Isn't it the worst? I sometimes can't believe how much BPD behaviors get inside my head

How much do you and your SO discuss her?
Her last message (as example) read: Is it creepy or pathetic for an old woman to buy someone else’s teen kids valentines gifts?
How did you respond?
Would her message chance your behaviors in the future? Meaning, would you give the kids valentine's gifts next year?