It's not unusual for a dog to have kind of a sideways gait when they're running or playing, so that you're seeing is pretty normal.
As long as it doesn't affect his mobility at all, I wouldn't worry about it.
It's doubtful that the running is affecting his gagging.
As with most things, in this forum it's hard to give you a 'for sure' answer about what could be going on with your dog and the cough/gagging. There are actually quite a few possibilities that range from the simple to the complex. Some of the biggest offenders are:
**Some sort of heart condition, such as congestive heart failure (also known as CHF):
**Upper respiratory illnesses such as bronchitis: http://www.petplace.com/dogs/chronic-bronchitis-in-dogs/page1.aspx
**Allergic reactions to inhaled substances such as pollen or dust: http://www.sniksnak.com/doghealth/inhalants.html
**Kennel cough, which is most likely if your dog has been boarded or kenneled recently, or if your pup has been around a large number of dogs in a place such as a dog park. http://www.thepetcenter.com/gen/kenc.html
**Canine influenza is not well known currently but is slowly working its way into the mainstream with more and more dogs coming down with it. http://www.petplace.com/dogs/canine-influenza-virus-dog-flu/page1.aspx
**Having a dog that is older or that isn't covered by a heartworm preventative can also develop coughs: http://www.gopetsamerica.com/dog-health/chest-lung-conditions.aspx , http://www.canismajor.com/dog/cough.html
**Finally, it could be that your dog is having what is known as 'reverse sneezing', which is also known as collapsing trachea.http://www.missionmedvet.com/encyclopedia/tracheal_collapse.htm ,http://www.beaglebuddies.com/misc/reverse.html
The easiest way to know for sure which of these problems is affecting your dog is to schedule an appointment with your regular vet. They'll do all the necessary work-ups (which may or may not include blood work and radiographs) to diagnose which problem your pup is having and the best course of treatment for you to follow.
Of course, it goes without saying that if your dog is having difficulty breathing, experiences lethargy or you notice a bluish tinge to the lips, gums or tongue, you need to seek medical attention for your dog at once as this is a sign that your dog is not getting enough oxygen for some reason and needs to be seen by a vet as soon as possible.
I hope this helps!