Not a fun thought experiment to be sure. I own a gun, and I am constantly awoken in the middle of the night for my "real job" so I have an unfair advantage. That is, I generally have my wits about me very quickly post eye opening. Still, I am not sure that discharging a firearm in the darkness of my house would be easy. I am in good shape due to said job, but that doesn't mean the burglar comes after me, they may have my 7 y.o. "hostage"... or something.
I would probably try to negotiate with a burglar. The only thing I really care about are pictures, videos and my family. They can literally have the rest... funny that sometimes I am a bit jealous of people when their houses burn to the ground. They get to start over... I always hope they keep offsite backups of what really matters.