If the H.O. motor was from '91 - '93 and you have an '89 the wiring should all be basically exactly the same. Drop in the H.O. plug in the old 4.0 harness but use an H.O. ECU.
Yoko Geolander A/T +II, AWESOME TIRES! With Just some coil spacers and shackles an XJ can run 30x9.5s with no rubbing unless the front wheels are turned to lock and the suspension is fully compressed, but even then its not much.
Is your o2 sensor good? If so then, go around and check all of you major grounds to make sure they are clean and well connected. Nearly every weird electrical prob is always caused by bad lead connections.