Consider that this may be out of your son's control. Habits are notoriously difficult to kick. There are plenty examples of adults who, despite being motivated to, simply can't stop biting their finger nails, etc.
If you consider that this habit may in itself be something he's suffering from, exacting punishment on top of that seems a bit harsh. I bet you wouldn't punish your son for getting the flu, for instance.
Instead of shaming your son out of this, I think you should consider helping him. If you want to incentivize, don't confiscate a toy that will be returned upon desired behavior, but instead agree on a reward he'll have when he has managed to kick his habit. Set achievable goals along the way, such as taking him to some activity when he has gone three days without performing his habit. If along the way you notice that the goal was overly ambitious, you need to introduce some smaller reward to praise his hard work, lest he should feel demoralized and give up.
There's a book called The power of habit by Charles Duhigg that has some really useful advice on understanding and kicking habits. I can really recommend it if your problem persists. It was a long time since I read it so I'm not sure I'm making it justice, but its central theme is that the anatomy of a habit is a habit loop which goes cue > routine > reward.
The routine is the performance, the habitual behavior that you want to get out of. Duhigg argues that it is triggered by a cue, which could be stress, boredom, a certain sensation or something that may seem totally random. The routine is carried out, and then there is the reward, which reinforces the behavior.
Most of the times, you'll only be familiar with the routine, and your job is to identify what the cues and rewards are. In one of Duhigg's examples, if you want to end a habit of going for a drink after work every day, you may identify that the craving is in fact triggered by a stressful work day, and the reward is relaxation. If you've come that far, you can look for ways to keep the cue and the reward, but replace the routine.
I have no idea what the cue is in your son's case, but talk to him, and have him think about these things whenever he performs his habit routine. How does he feel when he feels the need to do this? How does he feel afterwards? Is he bored? Perhaps he has a sensation of his skin being dry, and the routine feels soothing? Perhaps you could hand him a bottle of lotion to carry around and encourage him to use that whenever he feels the need to perform the routine?
Once you've identified the routine and the reward - which can be really difficult - there are other ways of breaking the habit as well. Perhaps the cue is such that it can be prevented, or the reward can be attained immediately. But I think replacing the routine, whilst keeping the cue and reward intact, can be really powerful.