The trick that helps with any sort of intrusive and/or repetitive thoughts: Arithmetic. Just add, subtract, divide, multiply two or three digit numbers in your head. It works like a charm!
P.S. I didn't read through the entire thread, so I apologize if someone already mentioned this.