Although I cannot give you the level of detail that I think you are looking for, I can offer alittle advice. I am in the middle of figuring out how to drop a 2000 4.0 into my 88YJ. From what I can gather, you will likely need to replace the motor mounts on your fram with the 4.0L mounts. The wiring will absolutly need to be changed. I believe that the 98 motor would be a ODB-II system, complicating the swap due to engine control/sensors/emissions, but not making it impossible. Some people say that the ODB-I motors are easier to get running, but I am in the middle of the ODB-II swap and so far it looks like it will be just fine. Others have taken the ODB-II motors, swaped wiring harnesses, sensors, injectors, etc. with ODB-I units to make life easier. With all that said, you will need the power distribution harness, engine harness, all sensors, engine computer,etc. to properly set up the motor. If the donor jeep was equipt with the sentry key security system (grey top keys, I believe that this was uncommon in wranglers) you would also need the SKIM module (antenna to pick up signal from key) and one of the original keys to make it play friendly. Of course, you can swap out the engine computer with one from a jeep without the security system to avoid this. Depending on local emissions laws, you may need the cats and such as well as a working malfunction idicator light, wich is a challenge on some of the newer motors.
Your transmission will probably need to be replaced with a slightly heavier duty unit. I believe that the 4-cyl YJs have a 21 spline input on the t-case, necessitating a change if you change transmissions. All in all, it is alot to think about.