Can you get a new ECM? They look to be between 30 bucks and maybe 80 bucks, used, online. Replace it and try it out. It could also be the distributer. It could be overheating. Try letting it sit overnight and see if it runs OK the next morning. I would spring for the ECM and see where you are after that.