Microcontroller software shutdown with transistor 2N4401
Your question is rather confusing, but some problems are evident just from looking at the schematic:

The schematic is crap.  I have no idea what you're trying to say with the dotted line between the - terminal of the the battery and the processor GND pin.

The line going thru the middle of the transistor is apparently meant to be the connection to the base, but this is sloppy at best.

It took me a while to realize you have the positive power connection at bottom and the ground at top.  Don't do that.

All these things make your schematic hard to read.  Now that I've had to waste time deciphering the schematic, I'll be more brief once we get to talking about the circuit itself.

You say the transistor is a 2N4401, which is NPN, but you show a PNP.  Huh?  Which is it?

There is no base resistor.  The E-B junction looks like a diode to the driving circuit.  When the digital output tries to go low, it will be held one diode drop below power.  That could damager the digital output or collapse the power supply.



Update

You have edited the schematic to show a NPN, but now you have a chip trying to drive itself thru a emitter follower.  The switch also does nothing at all since both its ends are already shorted together.