Experience is the best teacher...
...especially if you can use someone else's to your advantage.
Goetz clearly had some issues, making this a flawed case, but it's a good example to consider in case any of us find ourselves in a similar predicament.
Obviously, Goetz was about to become a victim, and the group of men were up to no good.
Goetz was carrying illegally. It's a personal choice, and I understand his rationale. I guess that's the first lesson: When you put yourself into this position, you need to be prepared for the consequences. Merely on that basis, he should have not displayed the weapon until absolutely necessary.
When the guy asked him for money, I think he should have made a neutral but direct statement (that would look good in court later): "Please leave me alone", for example.
I would retreat if possible, but in this case, I don't think he had anywhere to go. Nowadays, I guess you could get out the cell phone and dial 911 (again, looks good in court...).
If (or rather, when...) faced with a dramatic escalation involving force or at least overt threat, then I think I would make the decision to shoot. I don't believe in brandishing weapons. I would only pull it out when I felt my life was threatened, and that I needed it out to be ready to use it.
I don't think there was much problem with the actual shooting. He shot fast, and removed the threat. Even the debatable point of whether he shot them in the backs is arguable, because it happened so quickly.
Of course, he should not have fled the scene. He should have stayed, cooperating fully with the investigation, but making no statements without a lawyer present ("My name is....those men attacked me...I'm very upset and want to have an attorney present before I answer any questions...").
Even with the mistakes in the shooting, fleeing the scene, hiding evidence, imprudent statements, etc., Goetz almost avoided prosecution, in New York City!!