I've had intruders twice, so I don't have to guess what I'd do, I know.
The first time was when I was a teenager, home alone. Just a few weeks before, our house had been burgled, so I was antsier than usual. I was in the front room, and I heard the back door knob jiggling. Both parents were at work, no one was expected home. I'd heard that most burglars don't want to encounter people, so in my best scary voice (probably not very scary, I'm female) I yelled, "Go away. There's nothing left for you here," and whatever else I could think. I heard footsteps coming towards me down the hall. I looked. It was my father, home unexpectedly. Good thing I didn't have a gun. He was not pleased at the names I'd called him, but he probably didn't know I knew those words.
The second time, I was in my 40's, alone at my cabin 12 miles from the nearest road, accessible only by walking on a moose trail. There isn't a lot of casual foot traffic, if you get my drift. It was around 11 pm on the 4th of July, so it was dusky dark but not full dark (it's pretty far north). I awoke to two male voices laughing and making grunting sounds, coming up the trail towards the cabin. Needless to say, I was freaked. I reached towards my shotgun (I carry it to scare bears). But then I had to decide if I could really kill another human just because I was scared. I didn't touch the gun, and remained still.
They didn't identify themselves, and walked clear around the place, not coming too close to the door, thank heavens. I hadn't unshuttered many of the windows because usually DH does that, they're heavy bear shutters, so it wasn't obvious that anyone was in the cabin, and I wasn't about to say anything. Finally they went back down the trail, but not far, and I could hear them laughing and rustling around. I didn't get much sleep.
Two days later when I walked down to the train flagstop, I saw where they had set up a camp (on my property!), but they were long gone. Down at the tracks was a couple I know, the man about to set off fireworks. He stopped when he saw me. My eyes were still probably bugging out. I told them what happened. It was his teenage son and a friend who had been looking for their cabin, missed the turnoff, and walked to ours. They were drunk. They gave me their son's phone number and permission to call him and tell him what a close call he had.
So far, both times I've thought someone was out to get me, I haven't touched a gun, and both times it was the right decision. Your mileage may vary.