Eh, 6 of one, half a dozen of the other.
AR-15 has the advantage of precision, faster follow up shots, less recoil, faster method of reloading, higher capacity, and since some break-in's involve the bad guys wearing body armor, the 5.56 round penetrates that better as well.
The shotgun is very effective, but the mythical traits are pretty much just that.
-The spread of buckshot is not going to be more than a couple inches at close range, so you will still have to aim, but at the same time, it's not as precise as the carbine.
-The argument about 9-pellets vs. 1-bullet is true, but, doesn't take into account the velocity difference. Shotgun pellets moving at 1200-1300 fps are very different than a 5.56 bullet moving @ 2700-3240 fps. The bullet, being longer than wide, will tend yaw, and many top performing 5.56 bullets will fragment when that occurs. This is a very effective wounding mechanism.
-Additionally to the above point, when you factor in a person firing 2-shots from a shotgun, how many shots could a person with an AR-15 fire in the same time period? Not as many as the pellets in 2 00 buckshot shells, but I think it would be hard to argue the amount would be less effective than those 18 pellets.
-The sound of a person racking a shotgun may or may not scare a bad guy, but counting on the psychological reaction of a person who very well may be psychologically defective (after all, they are a criminal) seems to be a poor tactic.
-With regards to penetration, anything that is going to penetrate deep enough into a bad guy to reliably force him to give up, is going to be able to penetrate enough to put others at risk if you make a bad shot. Point being: Firearms are dangerous weapons. Place your shots carefully, you are responsible for what you fire.
As for me, I have both, but the shotgun is currently my go-to weapon, simply because of an eye-dominance issue. I am faster on target with the shotgun for the first shot with both eyes open. I am working on changing that, and if it does change, than my AR-15 will be #1. Until then, my Mossberg 500 loaded with 00-buck is what I would reach for.
Like I said, 6 of one, half dozen of the other.