Hi. Scottie person for over 17 years--so knowledgable.
I've had my Scotties do the fly-catching chomp before if we have a tiny flying insect in the house. This behavior is typically combined with walking/pacing as they track the bug. It looks odd because the insects can be so tiny.
If something is caught in the mouth you may see drooling and licking of mouth, pawing at the mouth or rubbing the face on the floor/carpet. Check the beard to see if her face is wet from drool.
As for the issue of petting her near the tail: one of my Scots would lick at her nose and press her rear end on the floor when her anal glands were full. My current girl does the scootering/rubbing on the floor. My best guess is that the dog may have some itchiness. Scotties are notorious for skin issues. The area at the base of the tail has seemed very sensitive in a couple of my Scotties. When I have visited strange places, mine have gotten itchy. If you are pet sitting in your home, this could be the case. The air may be drier or you could have an allergen she hasn't got at home. Also, fleas can cause major issues with Scotties. My Scottie with flea-bite dermatitis reacts similarly when you touch around her tail. And it can only take one bite to send a sensitive dog into a frenzy. Also, the chomping could be related to flea biting as well.
Good luck. I bet she is a cute little girl.