Don't forget...the older carbureted engines relied upon closing off the air flow to richen up the mixture in colder weather...on injected engines the system adds more fuel instead. If the computer does not know what the temp is, it won't do that and will either keep the fuel at running temp parameters or will keep it in "cold start" Usually though neither will cause the engine to shut down but will make run really ratty.
A real "head scratcher"...only thing I can think of is that there may be a poor connection either at the ignition switch or at the pump harness that is breaking down but eventually "spark welds" itself at times just enough to keep it running. Without the benefit of actually being there, the best I can do is guess which may or may not help. good luck though!!
sounds like a security system that has decided not to function as planned. try re-setting it.