This
https://www.insulcheck.com/ timer, kinda works like you want. They are cheap. I use them differently than pictured.
For each different pen, there is a different sleave. There is a switch on the unit. The way, I have mine set up, is I turn the timer around and have the switch look at the pen cap being removed instead. I secure the other side of the timer with Kapton tape which is easily removed. The tape can be had with either silicone or acrylic adhesive. You can bake the tape to 200C and it's still easy to remove.
I donlt know the battery number off the top of my head.
I take off the cap. use the pen and put the cap back on. When I put the cap back on, the device blinks a few times and starts counting. I have an older model. Supposedly this one has an improved switch.
I put index marks on the unit and the holder, so when a new pen is used, I can align it properly.
I'm thinking all you might have to do is wire a NC or NO switch and secure the sleave differently. The sleave clips onto the pen and the window on the pen is the indexing mark. The Insulchek device slides into place,
It's like pick up the pill bottle and putting it back down again.