I used to be a really bad nail biter. I stopped myself from chewing them by being conscious about when I brought my hands to my mouth. Every time I caught myself doing it, I'd force myself to do something else. About a month later, I found that I wasn't chewing my nails anymore.
If that doesn't work, try this: Cover your nails and the tips of your fingers with either masking tape or surgical tape. Then, put some knitted mittens over that and keep your hands that way for a few weeks. Sure, it'll look ridiculous but it'll keep your nails out of your mouth.