It is a nasty habit--I guess it's better than some--and I do it too. One way I've learned helps you stop biting your nails and grow them out is to kept them painted. If you put your hand in your mouth the nail polish will flake off into your mouth which is pretty gross and you'll learn to avoid putting your hands in your mouth.
Not to mention, no one likes to ruin a fresh coat.
You're welcome :)