I know biting is something I've used many times for the punishment reason you stated, but also I've noticed that there's a tiny bit of calmness just as it's happening, because the punishment is happening then and there. So for a little bit, you can drive the thought away. For me, that's only a little bit though, and before I know it, I'll end up thinking about it to no end. It's not something I really like because it's a very self-defeating thing, and it drives me quickly in a bad spiral.
Is this something that you experience?