It goes without saying that I cannot offer a diagnosis, but the OCD diagnosis is a reasonable one. The teacher will likely have to be influential in offering cues to your daughter, so (if she is not already) she should be seated near the teacher. Yes, she can receive some relief via medication. Given the severity of your daughter's condition, pharmacological treatment is a very sensible, even compelling, plan. Either confer with the psychiatrust who already did the prescribing, or seek another child psychiatrust. There are a number of options - e.g., fluoxetine, fluvoxamine and paroxetine, or even a small dose of another class of drugs often used to tame anxiety.
I dont know if its so much OCD , sounds like she found something she likes to do and cant bring her self to stop . Kinda like someone biting their nails it becames a habit but its not classifed as OCD if the child always does it. How did you find out when she was the age of 4? Poor little thing, but yes if i was you to be on the safe side i would get a second opinion. I have never heard of this at such a young age. BTW the kids in her class knows why she is doing the not sitting still thing? I wouldnt figure if they just seen her they would know she was masterbating. I have heard of kids like age of9 or 10 find the sensation spot like climbing a pole at school or little girls but i never seen them keep doing it as a habit
You may also think about home schooling her if it is truly a problem for you or her.
I agree - home schooling is a good idea if you can afford it. Also, while you are doing this, you may find the root of your daughter's anxiety. Is there something in the home that's bothering her or something at school. You can solve the problem temporarily by taking her away from it (assuming it's something at school) but it won't teach her to deal with these kinds of problems herself; so you find yourself and your daugther revisiting this issue at some point. On the other hand, bringing her closer to where the root of the problem is (assuming it's in the home) will teach everyone something and you can deal with it more effectively and perhaps your daughter can resume going to public school. Either way it's a tough decision to make and I don't envy you having to make it. Love is the answer and addressing it either way will show your daughter how much you truly care. Good luck with your choices.