Knowledge that it's an Aveira is largely academic, the question is, what is wrong with doing the aveira? The answer is, in my opinion, true fear of heaven.
Imagine if your dad or rebbi was standing there right before your face, would you do it? Now thing of this, Hashem, who created you and I, he created everything you see and feel, he created your father and rebbi stands right there, before you and watches everything you do.
More so, he is the one giving you the energy to scratch, and even once you do the act, the energy is his, so in summary: he stands directly before you, knows your thoughts, feelings, and intentions, and you use the energy he gives you to disobey his own directives. More so you are dragging your neshama, whis is an essential part of Hashem into the muck..
It's embarrassing if you think about it. This is something I try to meditate on daily, to the extent possible, to integrate it, make it so real, really feel it.. In my experience, mikvah helps, reading kerias Shema before bed with lots of concentration helps.
Another thing that can help at the moment of urge, is to say the verse 'Shema yisroel'. Memorizing the pitum haketores and saying it at moments of challenge can help..
Some practical tips,
Have a treadmill in your room, or at home, and start running as soon as you feel the urge.
Put on loud music.
Soak your feet in cold water
(Or call the simcha squad
)
These are not solutions, this are emergency interventions. The real solutions are in deep internal change, reference all the Dov material for that.
The above - remembering Hashem's precense, is to deter us from the act. We need to adjust the medidation after a fall G-d forbid.. When we fall, we should remember Hashem is with us now, in the muck, as he was with us before, he loves us as he did before, most important - he embraces us upon our return as he did before, regardless of how many times we have fallen..
The yetzer hara is a master. If you feel down or depressed after the aveira, or at any time you think of a past aveira, then know, beyond a shadow of doubt that the yetzer hara is the source of your thoughts. The logic is simple, if you are depressed, you need to feel better, which results in another fall, etc.
Unplanned, sudden, melancholy or depression over past sin is not teshuva, and is always the work of the yetzer. He will do what he can to pull you down.
People have lots of misconceptions about this, and as a result walk around depressed, slip, and fall. True teshuva means to simply say to Hashem 'I regret what I did, and accept not to do it again' that is teshuva. Yes it is that simple. (everything else, fasting, tefilos, tikunim, and the like are for cleansing the stain on the soul, not for teshuva, and should likely be avoided prior to stability and sobriety, and be performed under direction of a Rabbi who understands addiction). The highest level of teshuva to increase our Torah learning, to add a shiur, even a few minutes extra daily. Many people misunderstand teshuva, and fall further as a result of what they precieve to be "teshuva".. I should write a teshuva handbook to explain this, maybe when I have some time..
Bottom line be besimcha, in your original post sounds like you are depressed, put on the music, start the first dance, and when done, start the second dance, have the main course and dance some more.. By the time you are done you will be to tired and happy to scratch
As Rabbi Dr. Twerski likes to quote 'ki besimcha tseutseiu' simcha can help us exit any situation.
Chazak my brother.
DON'T WORRY, BE HAPPY, BE STRONG, YES YOU CAN