http://en.wikipedia.org/wiki/Tics
http://en.wikipedia.org/wiki/Obsessive-compulsive_disorder#OCD_with_Overt_Compulsions
I rub/scratch the skin around the edge of my fingernail, but I'm not sure if it's a tic.
I never really thought of this, but I think I have a mental tic like yours too... In my head I imagine certain words being typed out on a keyboard over and over again, and it's sort of satisfying if there are an even number of letters on each row, and a few other things like that. Sometimes it gets annoying because it always seems to be there in the background of my thoughts.
How does one get rid of a mental tic??
Yes, the 'mental tic' (I don't know if that's the correct term but it's seems to be the one we're all using) thing gets really complicated for me, I do the spelling thing, and I also alphabetize the letters in words, I used to trace the letters of words that people were saying with my fingers, and driving is just a whole lot ordering of numbers and letters of people's license plates...and at the end of the day I have some random word, or someone's name, or a street sign, stuck in my head.
I've gotten all of my tics to be less distracting by smoking pot...the first time I did was really powerful and I had this sort of trip where everything anyone was saying was floating in front of me and spiraling around, and it was all spelled wrong

I don't know if that had anything to do with it but anyway, after smoking heavily for about half a year a lot of my tics and general anxiety subsided. I think it just made me forget a lot of my fears :b and it definitely lowers you inhibitions. I don't know if this is for everyone though, and I don't smoke much anymore because it actually increases my anxiety these days. But a lot of people with anxiety respond positively to marijuana...I'm just sayin.
But besides that, tics should be less frequent if you are under less stress. I am not a doctor so I'm kind of just talking out of my *** here, but that seems to help me, to just do everything to decrease my stress level helps. But talking to a doctor probably would help.
I having started doing a lot of things to help get rid of them, like make sure there are no posters with words visible in my room, and before I go to bed I cover up my digital alarm clock with a hat...it used to drive me nuts, I would always know the numbers were there and I would look at them and add them up and arrange them blah blah blah...but now I guess I just have weird habits to cover up my weird compulses :|