simple. the firearm is the last resort. in the first scenario you mentioned, you have the option of retreating to a secure location in the home, dialing 911, etc. besides, unless he has a battering ram, he's going to likely spend a couple minutes trying to get the door down.
in the second scenario, for starters you dont mention distance. there could be enough time to put distance between you and the potential thug, or at least put obstacles between you and him. if there is no weapon you can see in his hands, are you really sure that brandishing your weapon is a good idea?
what you are talking about is escalating the situation pre-emptively. sure, its fun to fantasize about it, but back on earth with the rest of us losers, we gotta make sure that every other viable alternative has been at least contemplated before jumping to showing the potential thug the business end or our gat.
"Every man alone is sincere; at the entrance of a second person hypocrisy begins." - Ralph Waldo Emerson
"People demand freedom of speech as a compensation for the freedom of thought which they seldom use." - Soren Kierkegaard