I completely understand the tazer thing...

but a less evasive thing that works is placing a rubber band on your wrist and each time you catch yourself swearing....

SNAP!!

after awhile, you'll stop