Sometimes when children play doctor they are actually pretending that someone is sick or injured. This type of playing doctor is an example of the way children use play to recover from a traumatic incident, large or small.
It is a simple game of role reversal (the one who goet the shot is now the one who gives the shot), but it is very satisifactory. Getting the shot made her feel powerless and reminded her of all the little frustrations that she's had all the times when she hasn't been able to choose what to do or what to eat or what to wear - you know, the millions of things that children don't get to decide iin their lives. It certainly wasn't her idea to go get a shot that day. Playing doctor this way lets her recover because she gets to see you as helpless and powerless and undiginified, while she gets to be the powerful one.
The play shot might be pretend, but the need for emotional recovery is real. Play with a purpose. The purpose is to go through the incident again, but this time letting the scary feelings out -- usually through giggles. That's why a child like to play this kind of game over and over and over.
Sometimes, of course, the child does not need a playful approach; he just needs a lap to crawl into so he can cry about how much the shot hurt.
When children are discouraged or punished for attempting to recover emotionally in this playful way, they retreat into themselves.