I have had screwed up fingernails for years now. Mainly persistent hangnails like you describe, but also really deep horizontal ridges on my thumbnails, and occasionally vertical ridges on some other fingernails.
I think it's strange how the active ingredient in Head and Shoulders is some Zinc product, and how that finally resolved my folliculitis (which a dermatologist prescribed me antibiotics that warned not to use with colitis despite me telling him I would not take things like that at the beginning of the appointment)
I have always felt that whatever was wrong with my fingernails, if I could ever find out, would fix all of the other things I had. I know there is a connection. I believe the disease process caused me OCD like symptoms as well, which spontaneously and completely resolved by the way. My wild assed guess on this connection would be inflammation in the brain, or something (ie immune complexes) crossing the blood brain barrier.
But I hear your concern regarding the fingernails. Which reminds me, there is a form of OCD (obsessive compulsive disorder) where people constantly pull their own hair out, or shred their cuticles. Most people probably look at that and think it's just odd, sick behavior. (the cold mechanics of a modern philosophy of mental illness) But who's to say that there is not something also wrong with the cuticles which makes them pick at them (i do constantly). Not so far fetched really, maybe there are malformed microvessels or capillaries or what not.