It occurred to me that merely showing the gun and threatening to shoot in hopes of scaring the guy away might not have been a realistic option because of poor lighting and my assumption that an XD9 is black. If the guy had been armed, I think he would have already demonstrated that rather than hit someone with his fist.
I think it's always the case with self defense that "you had to be there", and I think the law generally allows for that reality.
I do note at the range that some shooters are in the habit of shooting more than one round at a time, usually three. In this case, the first wounding hit in the leg would have played better as others second guess what did happen or should have. Also I think I would say that one shot as if it was your last cartridge would make for a better shot. Spraying the area like you have a machine gun sounds like watching too many movies. The quality of shooting and number of shots doesn't sound very good for close range.
I couldn't say what I would do if really scared, but I do know what scenarios I have rehearsed in my head. I also try to think of range time as somewhat realistic. Never mind the macho bang-bang-bang stuff.
Of course, part of the problem is relying upon a 9mm. That could be one reason why the perp isn't dead after taking a belly shot.
One thing I wouldn't do is make an insurance claim to patch a bullet hole. You're going to quickly find out how your insurance company feels about guns. Pay for it out of pocket and leave well enough alone.