So I've done my best, but I'm very new to this.
Hopefully here's a picture:
When everything is powered from 3 AA batteries the circuit works as I expect. When pin 4 goes high, the transistor shuts off, when pin 4 goes low it switches back on.
I plan to read in a sensor value on a different pin...