I’ve often thought about some sort of system that has electrical contacts when the metal hooks make a circuit on the metal eyes. For power tops when the circuit is closed (hooked) it would lock out the motors. For manual tops there could be a warning light.
When I ran a carputer in my old van, I had wired the latches to for an indicator input. The red van with a pop top in the upper indicators meant at least one of the latches were undone.
I basically had to isolate the metal eyes and such ground the back one and ran through each connection. I was surprised that it worked very well.
For a motor lock-out you would probably have to wire each latch in parallel.