Very sorry that you had to go through this, and I'm thankful you're willing to share so we all can learn. It has been an interesting discussion. I'm a newbie to it all (firearms and SD) and am not trying to be judgemental or say anything about what transpired, only understand better.
During the first incident, was the thug just holding the weapon, or taunting/threatening with it? Of course, even if he was just holding it, that could change in an instant. Did he advance when others backed away?
When you knew they'd be back and waited outside for them, you've said that that was to keep any conflicts outside, away from your family. Was there enough time where you could have had your wife and children leave while you monitored the situation? I understand not wanting to completely leave your home, but would this have helped you defend better? With an empty home, would you choose the same course of action?