My daughter fainted at her allergist's office a few minutes after having 11 (yes, 11) injections in her upper arm to test for several allergies. My daughter is not afraid of needles, doctors or procedures. The PAIN associated with 11 injections was just too much for her and she did almost exactly what your daughter did. Thank God I was standing next to her as she would have fallen off the exam table. She came to in what seemed like forever, but was actually maybe 30-40 seconds. The doctor rushed in and raised her legs and lowered her head. She was perfectly fine within 10 minutes. Me, not so much.
I later learned about the vegus nerve response. I now know that it's a possibility that my daughter may faint from pain in the future. I've explained to her (she's now 12) that if she ever gets hurt in say, gym class, and feels like she's going to faint - she HAS to get down to the ground immediately. My daughter had maybe 15-20 seconds of warning before she fainted. She knew she didn't feel well.
If your daughter really did have the vagus response, teach her that fainting won't harm her (you still breathe, etc.) - but falling and hitting your head when you faint can be dangerous. Make sure that her school nurse and teachers are aware of this going forward.
I was prepared for my daughter to faint when she had her ears pierced recently. I'm happy to say that she did fine and didn't have any problems. Her initial passing out was WAY more scary for me than it was for her. I'm sure you'll agree that it was the same in your case.