Sniffing the air like that is a bad sign
I kid you not, somebody once said that to me. When dogs go still, close their mouth, and sniff the air, it’s a bad sign. It means they’re going to be aggressive. The person who said that to me was serious and told me that she’d seen it happen lots of times.
I can’t know what her experiences with dogs had been, but I saw her comment as yet another example of prey drive being seen as a bad thing. The reason that dogs often close their mouths to sniff if they are intent on finding where the source of the smell is because it is easier for them to do that if they breath only through their nose. Try this to see what I mean. The next time you’re out with your dog and they have been running enough to make them pant, pause for a couple of minutes and press some pieces of food into the bark of a tree. Then, let your dog search out the pieces of food. The chances are your dog will close their mouth when they are searching for the food.
My feeling is that some people are worried by the stillness and the closed mouth sniffing because it looks intense. And perhaps sometimes it is followed by the dog taking off after a prey animal. I would encourage you to try and notice your dog start to sniff more intently by closing their mouth or being still. It’ll become a great indication to you that there is something exciting around. Then you can do something to make sure that your walk doesn’t get stressful. You can go in another direction or pop your dog on the lead. With training, you may even be able to teach your dog to keep still for longer periods of time so that they can enjoy sniffing without taking off. It all starts with you noticing.