Well, I saw the switch with the ring. If you make spring of the switch softer, then you can go in Toys"R"us and buy /they use to have those toys/little like ball doll which start to shake and jump when baby start to cry. If you attach it to the switch it will bounce and switch it off under alarm stress. Kind of MacGyver thing which is not the best for protection.
I'm working in high end digital cameras company where products are invented. I have all equipment, parts, engineers for free and I still bought ready product/you remember my 4 tanks rack/there is a link $70 total.
With 2 words. You have very low voltage , amp etc signal from the alarm .In order to shut down valve you will need a lot more power. Then you have to buy power supplies, electrical relays-$15-30 each, resistors, some diodes, etc. Just too expensive if you like to make it right
It can be done cheap but then we can’t rely on it.