If I can throw in my two cents worth please.
I do not know the OP's living situation, whether he is in a house or and apartment, in the city or out in the country. If he lives alone of has a family and kids in the house, so my advice will be generic for the most part.
If you live with others in the house, a shotgun is the wrong choice.
If you live in and apartment, again, very much the wrong choice.
You need to be able to control every projectile you launch, and a scatter gun can throw it where you really don't want to. A slug can go right though and then a wall or two and someone else.
Buck can give you 9 .330 caliber balls at one time, again if one misses, everything you own is riding on it.
A pistol with a tac light is a far better choice IMHO, far more controllable.
Now, If you live in the country or there is lots of room between you and your neighbors and it just you or you and the wife, then okay, a 20 gauge with no#4 shot will do all you need.
As to using a AR, if it's in 9mm or 300 AAC blackout (As long as your using the subsonic 220 grain loads) it can work, but in 223, any barrel length one shot and everyone in the house will have some permanent hearing loss.
Then theres the over penetration issue. If you miss (Or only hit soft tissue) and your not using personal defense softpoints (Ball ammo can go through 7-9 walls), yours, your neighbors house, right into his little girls room. The even if it was a totally righteous shooting, you will have a DA filing reckless endangerment charges....and your neighbor suing you.....and telling all the other about the wantabe Rambo with the big gun......
Now I am sure that there are many here who know all this, but I put this up for those who do not know this.
I will now get off the soap box, and if you want you can flame me if you like.