Actually the story is that in that scene originally Ford was supposed to fight that guy but Ford was recovering from the Flu or a Bad Cold and was took weak to film the scene as written. So they cut the fight scene and had him shoot him instead.
What I had read is that Ford did it spontaneously on a lark, and they liked it, so they decided to keep it. They thought it was better than what they had written in the original script.
It was.