Well if the guys gas is gonna leak, its GONNA leak. I see some replies about "well it could cause an explosion" yeahhhhh but in his defense, if the things leaking gas, its already leaking gas into the house, so having a valve ATTEMPT to fix it until he gets there isnt a bad idea. Now of course the valve COULD leak but thats what his sensors for.
Heck even a water valve is a BANDAID and when it closes, its closing for a reason, something has to get fixed.
If his gas sensor goes off and it ATTEMPTS to close the valve, again its a bandaid to prevent more gas from going into the home then it detected.
I like the idea, but like most said, gas has different codes and you'll want to check on it. If you go AGAINST code you may be liable and not only that, your insurance MAY NOT cover any damages in the event of an issue.
But unlike water, where if your water pipe starts leaking and you don't know about it it'll cause a lot of damage, which is what sensors are for to say "hey you, check your basement its leaking" a gas sensor will do the same... only when gas leaks its not necessarily going to start causing damage.
What i think might be an alternative to this, is to have the gas sensor trip a fan relay to EXHAUST any gas in the area it detected it. Gas doesnt do damage right away, its when it builds up enough in an area to become explosive it can level a house (Happened a few towns over from me earlier this year). But if you have something that goes "ohh crap we smell gas" and then it alerts the fire department/you and at the same time starts to VENT that gas, well then at least your giving yourself some added insurance that not only is the fire department on the way, but your also venting that gas out of the house to prevent an explosion