Anytime the ECM wire is disconnected from the battery the ECM will have to "re-learn" when it's hooked back up so it will be redundant to unhook it the second time. You need to determine if it is switching between open and closed loop, my guess is that it is not. If you are staying in open loop all 6 injectors will continue to pulse causing the engine to "load up" with fuel and foul the plugs. This can be caused by a number of things including (in order of most likely, in my opinion) bad MAF, bad O2 sensor, bad coolant temp, bad ECM. You will need to determine rather or not the different sensors are reporting properly. If they are but the ECM is not going into closed loop then the problem is in the ECM. Here is a pretty good explanation of open vs. closed loop.
http://www.thirdgen.org/open-loop-closed-loop
Keep in mind that even though these cars were pretty "hi-tech" back in the day, they are not exactly rocket science by today's standards. The ECM wants to maintain 14.7 to 1 air to fuel ratio. It does that by adjusting pulse time based on engine conditions at any given time. It can only translate the information that it is given. Bad info from the MAF translates into bad calculations from the ECM which translates into the wrong fuel to air ratio.
I hope this helps,
Hugh