Tech_Esq
Sic Semper Tyrannis!
Personally, i would propably use the Katana (actually the Wakizachi, doubt I have enough room to swing it in an appartment) I have next to my bed, I can propably apply it much faster than loading a gun, since according to most gun laws I would have to stash the gun and the ammunition in different and locked places. In that situation, it would be dark, and I would know the place so we may have one of the few instances where bringing an (oversized) knife to a gunfight (what is the other guy armed with?) may work.
Besides, I would prefer a G-36 (looks way cooler and is easier to aim with, besides its a good bit shorter) whose 5.56 caliber should not go through that many walls.
However, I have not been in this precise situation (fight for my life yes, but a knife armed opponent is something different from a gun toting one, although beeing unarmed sucks in both cases) so I do not know how I would react.
Given the shortened distances in an apartment, you would have no guarantee of being able to bring a G-36 to bare even with stock folded. You may have to engage the target within 6 feet which means you personally are endangered by an unarmed intruder (knows martial arts) or armed with a blade weapon or firearm. Accurately bringing the weapon to bear (aiming) would be extremely awkward in this case.
To my point about going through walls, although you are correct in that the 5.56 NATO round would not penetrate as many walls as a 7.62 x 54 mm round would, with a mx effective range of 800 meters, it ain't stopping at your apartment door. You are still endangering more innocents by using a rifle instead of a pistol.