I am no furnace/water heater guy, but if the pilot would go out after a cycle, not relight, but can manually relight, I wouldn't think it is the gas valve - gas is present if you can manually relight. Unless I don't understand the system. What tells the pilot to relight??