The valve regulates the amount of coolant that flows through the heater core in order to regulate the temperature. Either the valve is faulty or it is recieving the incorrect signal. The fact that it keeps shutting off and on would lead me to believe that it is recieving an incorrect signal for some reason, but I do not have a great deal of experience with this. Hopefully someone else here can give you advice on how to further diagnose your problem.
1999 Dodge Ram 2500 Cummins Diesel
2002 Harley-Davidson Fatboy
Merlin Extralight w/ Campy Record