Those wires are part of a high temperature limit circuit. Bypassing that feature is potentially VERY dangerous. I am sure that the gas valve manufacturer specifies that if that limit is tripped, or malfunctioning in any way, the valve MUST be replaced.
You could call a tech line at the water heater manufacturer, or the gas valve maker, to confirm the function of those wires, and how to proceed.
Now, I would think twice about spending any more money on a 22 year old gas water heater.