I don't have any suggestions, but my mother has been in your shoes. *I* used to do that too as a little girl. My mother would find bunches of hair on my pillow the next morning. What I did was twist my hair until it came out. I still had this habit in my twenties and early thirties...although I didn't pull my hair out...when I was relaxed, sitting there, or just thinking, I would twist my hair. It was just a calming thing. My mother was never able to get me to stop.
I'm sorry that I don't have any suggestions, but I just wanted to let you know that it's a habit that does need to be broken, but not sure what to do. Someone mentioned a doll, but the doll's hair wouldn't be as soft, unless you got one that was and she was able to put up next to her head and play with that way. Our head is so much more convenient, unfortunately. :/ Good luck!