Yeah check to see if you have 24 volts when its messing up. If it does i would say its the valve but i hate to tell you it is with out seeing it in person and then it not be. But when i have seen others heaters act kinda like this its been the gas valve. But its hard to say with all the other things some heater have and some dont as far as saftys and what not.

So check the 24 volts before its on when it starts ect. It should have it a little bit after the ignitor starts to glow. See if you lose it when the gas stops or what. Thanks matt