It's no question that most gunfights occur at conversational distances, hence the importance of moving before, during, and after shooting. Before those, I think it's important to preset the mental trigger. Personally, some of these preset mental triggers are the items held in the adversary's hands (gun, knife, baseball bat, lead pipe, etc.). Other mental triggers are disparity of force in terms of physical build and multiple assailants regardless they're armed with UZIs or just plain bad attitude.
How you engage a lone assailant is important too. It is generally favorable to move laterally towards the strong side of the assailant, i.e. the back of his gun hand. Given the the distance, we may even expedite this to our advantage by slapping his gun hand towards his weak side while drawing our pistol (another reason why practicing one-handed shooting is important). The reason for this is-- it is more difficult for him to redirect and reorient from this position so he can hammer you COM post haste. Imagine you're a right-handed baseball pitcher and your target is 12 o'clock. It's easier to redirect a throw to 9 o'clock in the last fraction of a second rather than on the other side, 3 o'clock. The 3 o'clock position is generally where we defenders want to be.
There is no clear cut rule in winning gunfights. It is a situation one must avoid as far as the circumstances will allow it. But knowing what to do, having preset mental triggers, and most of all, the combat mindset of keeping your hide for yourself and your loved ones, might very well provide us a fresh lease on life one day.
The sword that cuts down evil is the sword that gives life.