wow i just started to do this sometimes i have a pure-o form of ocd it started physical tho and lately sometimes i just shake my head to get rid of these thoughts as well it happens when a though is in my opinion so bad and i feel i just cant process or justify it obvioysly now its becoming more and more automatic which is dangerous  yes it is defeniteley not a good thing to do 100 whereas the right thing to do is leave the thought and the subsequent anxiety what you do is creating a new ocd coping mechanism to ignore the anxiety the thought gives you however on the long run this will make your ocd stronger and harder for yourself to fight it   lets both try to minimize it from this point you have to start somewhere hang in there