I would suspect that some of that wiring is the elecric choke , that is why the bike starts but stops after a while as the choke system shuts of , it thinks the engine is warm and is no longer required ,but if the engine is stopping it sounds like you have a blockage in the idle system, that would also account for the restarting after about an hour the choke system has opened up again.
Give the carb a good clean out it should help.