I put an earthquake gas valve on the line downstream from our meter as soon as we moved in back in '83. It's a real simple gadget -- a ball gets knocked off its perch and lands on the gas exit hole in the valve. No moving parts except for that one ball.
We rode through the 1989 Loma Prieta quake just fine and it didn't kill our gas.
Note the low-tech "level" to get the valve properly mounted. Anybody living in EQ country needs one of these (at least until the GD government steals your water heater, furnace and stove)

That’s a good idea. If the BIG one hits though, I imagine all pipe lines will break.