I had been on the edge of seizures myself, most recently as a result of generic Wellbutrin (Bupropion) and overstimulation with supplements (Racetam). I'm pretty sure antidepressant psych meds are not good for tbd and co-infections, remembering a few foggy texts.
I wasn't and still not sure how to prevent this, it was frightening.
But I try to take relaxation supplements like L-Theanine or Magnolia Bark extract or a mild sedative like Hydroxyzine as last resort. A cup of Peppermint tea is good and possibly Chamomile might calm it down too. Magnesium (Citrate or in Epsom Salt bath) could be a good go to.
I want to say look for supplements/meds with anti-convulsant properties but this info may be above my pay grade, I think Magnolol the active ingredient in Magnolia Bark extract has anti-epileptic properties
https://www.ncbi.nlm.nih.gov/pmc/articles/pmc3221106/ And CDB oil I hear is good for stopping seizures.