I have the looping too, esp with music. So annoying when it is the Sesame Street song 'one of these things is not like the other'

I find it happens most when I am having a lot of anxiety going into a mood episode, this usually comes out as dysphoric mania. I usually journal in notebooks and during these times, I repeat things for pages, the same thoughts in different ways. So I have a visual of sorts of how my mind is looping my thoughts and what the thoughts consist of.
Now, I just have had an incident the last two nights where I was thinking about this guy that just broke up with me and I managed to get myself totally worked up with the thoughts, I didn't sleep for 36 hours and I think the exhaustion and constant thoughts made me feel over the top and I had a crying meltdown. I am better today, after 14 hours of sleep but it occurred to me earlier today that perhaps that was a 'mood moment' and I probably should have taken something for it? I normally take saphris when I have racing thoughts that won't stop and make me unable to sleep. I am trying to decide if it was a bipolar moment or a normal breakup behavior. I haven't been broken up with since 2010 so it's not really a familiar event. In fact, that particular breakup ended with me in the hospital (I'd been manic for 10 months and it precipitated the crash into depression).
Just curious what you all might think of that?