It could be that she's teething. She's about the right age for that. I had a shih tzu pup with me from 5 to about 8 months of age. I remember finding her little teeth all over the place. Because shih tzu have little squished in faces, her teeth were came in all higgledy-piggledy. Not all her baby teeth were pushed out by the corresponding adult teeth, some came in right beside them and the baby teeth just hung on. I pulled one by hand and the other one was a tiny one on the bottom that I just couldn't get ahold of so I had the vet pull it when she got spayed. One of her top canine teeth sticks straight out. She would be a good candidate for doggie braces!
If you question whether it's teeth, you'll need to get a look into her mouth to know for sure.
Shih tzu also tend to have protruding eyes that are magnets for hair to stick to. That will definitely cause face rubbing, and having something irritating in the eye can definitely be painful enough to cause yelping. The hair around your dog's eyes either needs to be kept clipped short or tied up so it's not irritating their eyes. The hair between the eyes is especially troublesome as it seems to want to grow straight into the eye (that would drive me nuts too!)
You should already be in the habit of handling your pup's ears, eyes, mouth, paws and, yes, the "privates"

on a regular basis. If not, now's the time to start. These are areas that dogs typically don't like to have touched so they need to be desensitized, preferably starting at an early age. Dogs that aren't used to being handled are dogs that end up biting their vets. (Vets need to examine your dog in these areas) IF they get agressive, then they need to be muzzled which just stresses them out more. Do your dog, yourself and your vet a favour and get into this practice now if you aren't already ... and keep it up for life. Your shih tzu will require regular grooming too, so your groomer (which may also be yourself) will thank you for this as well.
Because you say it happens when she gets all excited (like when she's meeting someone new) or when she wakes up (do you crate her? and if so, is this activity occurring when you take her out of the crate?). I do have to question whether it's really teeth or eyes.
Having not seen the actual behaviour, I can't say for sure, but if it only happens when she's excited, could it be that you're misinterpretting her invitation to play? Is this your first dog?
I wonder if it's possible that what you see as rubbing her face and yelping in pain might be an exaggerated play bow and excited burst of barking and running around intended to intice you to join her in play.
I can provide a little more detail of what this little "come play with me" ritual might actually look like if you're not sure what I mean.