It's not a million miles away from it though.
Typically gas stoves have a failsafe safety system that uses a thermocouple to keep the gas on only when there's enough heat.
If you used a timer to break that safety circuit (relay?), the solenoid will revert to it's safe state, and turn off the gas.
Doing that safely may be difficult. And doing anything with a gas installation may be illegal, depending on where you live.