Instaed of Transistor, you can optocoupler or relay, try to isolate the MCU GND and Membrain Key GND / Common,you can use PC817 opto for testing or SPDT / SPST relay.
Yes you can use all the pins, except NRST and Boot pins.For programming your ic you can give UART line with additional jumper and add the SPDT button in Boot pin, connect one line to VCC and other to GND, so whenever you want to program your controll...