They switch positions when you go out in the open, saying a long gun is much better, and there they prefer the shotgun for most people. Remember the old trench fighters of Vietnam, a 45 and extra ammo ... I think if I were doing entry attacks like SWAT does, then a shotgun would be my preferred weapon, with low intensity rounds.
The best way to figure this out is firing different weapons in enclosed ranges. Or even shooting a CQB course. What ever works for you.
this is not for searching rooms with. The use of the long gun is when you have secured all the loved ones in a safe area that you have to defend until the cops arrive.
If one is searching rooms looking for a child, for instance, a handgun is the best weapon for that task.