A more low-tech solution, which is recommended by countless self-help books/webpages of dubious authority, is to snap a rubber band against your own wrist when you have done something bad. It seems this should work roughly as well as the Pavlov? In theory it should suffer the same "can't condition yourself" problem. On the other hand, if lots of people recommend it, then maybe it works?
I suspect that if electric zapping or snapping a rubber band work (I don't know if they do), they do so by raising your level of attention to the problematic behaviour. A claim of Perceptual Control Theory is that reorganisation -- learning to control something better -- follows attention. Yanking your attention onto the situation whenever you're contemplating or committing sinful things may enable you to stop wanting to commit them.
See also the use of the cilice.
If it's worth saying, but not worth its own post (even in Discussion), then it goes here.
Notes for future OT posters:
1. Please add the 'open_thread' tag.
2. Check if there is an active Open Thread before posting a new one.
3. Open Threads should be posted in Discussion, and not Main.
4. Open Threads should start on Monday, and end on Sunday.