Overall, I think the OP did alright. Only two things I would've done differently:
1. Leave the line to 911 open, keep them talking to you so they can hear everything. It might come in handy, should the worst happen and you wind up in court
2. Getting behind some kind of cover would've been ideal, instead of just standing in the open.
What's not ideal is simply waiting and blasting the guy as soon as he comes in the door. Buckshot makes a mess of everything - the intruder, the drywall, household items, not to mentioning scaring the heck outta the cat and the neighbors.
Has anyone considered bear spray or a tazer? My CCW instructor, way back when, repeatedly told us to get something to go in between "don't come any closer" and "BANG!". Having been hit with both bear spray (note: not keychain mace, actual made-to-stop-large-angry-ursines bear spray) and a tazer, I can vouch for both. The bear spray felt like my face, eyes, sinuses, and lungs had all been napalmed, and for a half-hour afterward my
only priority in life was water. The tazer was worse - I went from standing, laughing, still blowing my nose after dealing with the effects of the bear spray, to feeling like someone had just dropped a bulldozer on me from altitude. It was at least 15 minutes before I even wanted to contemplate getting up. Now, I'm a big guy, and no stranger at all to pain - but both the bear spray and the tazer absolutely rocked me. Both weapons are stand-off (my bear spray shoots a decent-sized stream about 30 feet, tazers have range as well) and really, if this is in the front entryway of your house, you don't need to be shooting sub-MOA groups
Now, a fair number of posters have pointed out how they would legally be justified in shooting the large, angry, stupid drunk. But really, people? This is The High Road, not Call of Duty. I forget who said it, but the quote is along the lines of "Violence is the first choice, and the last resort, of the intelligent man". Yes, you would be justified in shooting the guy, if he's out there screaming how he's going to kill you and your family with a shovel as soon as he gets in. But if you had as long as OP did to realize that it's some stupid drunk who has the wrong apartment, pulling the trigger once he gets in seems like a poor choice. Get the bear spray, or get the tazer. Some people claim they aren't as "effective" as a bullet - and to those people, I say: try it. Have someone hit you with the spray or the tazer, and then see if you still feel capable of doing anything besides laying on the ground.
That's my two cents. Give yourself another option besides the gun. Just because you
can shoot the guy, doesn't mean you
should. Not when there's another option.
Go well.