Poor baby...sounds like she is really acting out for attention. It sounds like you are doing all the right things when she is with you, not a lot you can do about what is going on when you are not around. Maybe you could sit down and have a heart to heart with your daughter and let her know your concerns?
I think she is very lucky to have you in her life...I wish I had more advice for you...but I will keep you in our prayers.
I didn't even think it until I started reading some of the other advice, but you may want to have her tested, I have an Autistic niece and also a niece who falls in the spectrum of Aspergers, the niece who has Aspergers when she is stressed or overwhelmed will do "crunches" and she has done this since a very early age, also my autistic niece will bite herself or beat her head against furniture, it can be very disturbing, but for her it is a way of "centering" herself, being able to be "aware" of where she is in relation to everything else. I am not saying that this is necesarily what is going on with your granddaughter but even if it is, its not as scary as it sounds...and its better to know, because the parenting advice that you would give for a child who falls in the spectrum can be very different. I do wish you all the luck in the world, regardless of what is at the root of your grandaughters problem, it seems you are her rock.
Sorry for my long post.
God bless you
SAHM of a 13 month old son, a 7 yr old daughter and a 12 and half yr old son.