AKM would be my choice over a pistol or shotgun. As others have mentioned, any round capable of reliably stopping a man will penetrate drywall. On the other hand, the intruder may be wearing a heavy jacket, on drugs, etc., so a rifle cartridge that can stop him within the confines of your home (before he can close the distance) is crucial. If SHTF the AK can be used as an impact weapon, especially with the slant muzzle brake.
From this page: http://www.warriortalknews.com/2010/...our-house.html
There are multiple scenarios for a home invasion, for example:
1. You wake up to the sound of glass breaking downstairs, so you get out of bed and take your gun to investigate. This is the ideal scenario and you can avoid confrontation by barricading yourself in your bedroom and calling 911.
2. The intruder climbs through a bedroom window and you are awakened by the sound of your kids screaming...
For scenario #2 a shotgun would not be precise enough because the intruder could be mingled with family.