Hi purplepumpkin,
We seem to be in a similar boat. I had the problem for as long as I can remember, just another nervous habit I think. I manage to quit for periods of time when there is enough outer influence, example there was a year when I worked mostly at hospital wards and in the operating theater and could not afford to bite my nails during that time. Was scared of infections like ****! lol
Anyway, after getting an office job with plenty of stress it all came back, especially during very stressful times. For me using polish works quite well. The trouble is that we were never allowed to paint our nails at the University and I also grew up in a very conservative family that basically associates polish with whorish.

So, while I don't feel comfortable wearing it, I do it when aware that some important event or meeting is coming up in a few weeks when I must look my best and most professional self.
I hope you will succeed in stopping this habit yourself and share some of your experience later on. Best of luck to you!
