I overthink all the time, and I notice no negative side effects from it other than not being able to fall asleep easily. Quite on the contrary, I'd say the net effect is overwhelmingly positive.
Your problem seems to be a lack of focus and its resulting compulsion. If you want to practice focus you can just try to pay attention to your breath and increase the duration of that exercise over time, or practice calculations or other short-term memory tasks in your head.