I have a used 1990 mighty max with 46g4 with about 157,000 miles efi auto. I bought this truck from a mechanic said that the truck at one point dumped serious black exhaust and replaced the o2 sensor and ecm. The truck runs rich you can smell it. So i unplugged the o2 to see how it ran, got better but the exhaust got smokey. The check engine would come on go off come on go off and was recently stuck on for o2 sensor. I accepted this at 15-17mpg. So recently i went to put in a new stereo system. This is where things get messed up. Someone cut out the original wire harness and wired a new one for a tape deck. I pulled all wires. The check engine light went off, also my door alarm stopped working along with cigarette lighter. Now if i let the truck sit for a day or two when i start and go to reverse there's a loud clicking noise under the hood for a second or 2 then goes away and won't happen for the rest of the day. There is also a switch on the dash next to room dimmer that has a wire running to the fuse box and is also grounded to the frame. I flipped once and noticed nothing. when trying to plug in the new stereo i unplugged and can't remember where it went. Does anyone have an idea where to start.

things i've done:
new wires
new plugs
on 2nd tank of rxp
checked all vacuum hoses nothing looks wrong
checked fuses all are good
temperature sending unit looks new
new belts
new air filter
(not all of these were because i thought they would fix the problem but because they needed replacing)

I want to replace the engine with a v6 but that is going to take some time so i need to figure this problem out.

Thanks!