Man's Best Friend
A dog is your best early warning system, unless your yard and drive are wired with cameras and trip sensors. Most dogs will warn you long BEFORE the BG is actually in the house, giving you those necessary precious seconds or minutes to gather family, arm, barricade, and call. Not knocking alarms, but they only trip when the BG is already IN the house. Also, even a lap dog can make a lot of noise, and if you know your dog, there is a play bark, an annoyed bark for the squirrels, and a danger bark for intruders. Definitely different sounds. Big dogs may not be practical depending on where you live, but they add a serious physical threat to the would-be intruder.
Gun right beside the head is generally considered very bad juju. Too easy to grab before you actually wake up and shake out the cobwebs, grab it while in a nightmare/dream, etc. Really, the two steps to cross your room could save lives you care about, and won't seriously impact your self defense unless the BG is already in your room. In which case, the two steps don't matter, as your options may be limited to a furious physical attack on the BG.
My situation: because everyone sleeps on the 2nd floor but kids are down the hall, my plan is wife on cell ready to call 911, me hugging open doorway, listening, assessing, and covering stairs, will gather kids if situation assessment allows, and then the barricade-in-the-bedroom is in play. Otherwise, no one will come up the stairs. 13-rd .45 auto, with 12 round spare mag + 500 lumen torch, should present a barrier to climbing the stairs until the cops can arrive.
Would prefer 12ga but safe is in my office, between BR and kids rooms. Besides, the pistol holds a lot of rounds. Unless i remember to unblock the mag, shottie only holds 3.