I have a lot of weird mantras and motions that I feel the need to do throughout the day as well. I've had this since I was maybe 6 or even a bit younger.
As far as I know, they're called tics. It's voluntary but something you feel the need to do.
I have have yet to find something to curb it myself, but if I keep myself busy and allow myself to do some of the more minor, unnoticeable ones when I feel the need to I don't get the urge to do the bigger ones so often.
I also find that allowing myself to do one too much in one go can make me want to do it even more, so I'll try to do the tic until I'm satisfied and then distract myself from it.
As long as it doesn't interfere with anything in your life then don't worry too much about it. Having repetitive little habits is sort of a throw back from a time when humans had to be more cautious, like checking and double checking that there is no danger before going to sleep, or constantly checking on food, wiping away bugs, making sure there are no defects in the shelter or weapons. The people who tended to have these habits back then were much more likely to survive and get a chance to pass on their genes. We no longer have so many outside threats so we tend to settle for weird little habits to keep this trait busy.
Sorry I couldn't really do much to answer your question but I hope this helps :)