woah there buddy!!!!!!!!!!!
the transmission is from a 2004???????
You said you replaced the engine you never said anything about the transmission.
the 97 computer will NOT control the 04 transmission, there are many differences the wiring pins change locations, the 04 DTRS (or digital transmission range sensor) is a digital sensor instead of analog like your 97 uses, this is a huge mess if you dont know what you are doing!! This can likely be fixed using parts from the 97 transmission unit.
I do not expect the dealership will figure this out anytime soon, Looking at the two autos side by side they look very similar, but the wiring is NOT THE SAME and I know for a fact the DTRS is not the same
No wonder your computer is freaking out!
Why did you not mention this sooner?
Dealers charge $80 just to put it up on the rack.