Need some help with H11AA1 circuit

Thank you to everyone for the help!

@larryd I did get it to work with the diode and cap, but I am going to try to rewrite since my program does create a slight problem. If the switch opens for a sec and the timer starts the countdown and the switch closes again the timer keeps going to zero and the solenoid does stay open until the next switch release and then the timer starts again.

So it does work, just not gracefully.