I just swapped a 93 into a 99 this summer ( my 99 is pre distributor-less ignition like your 98 ).
You probably have a 7120 head on the 94 and an 0630 on the 98 which means you just need to block off the extra coolant temp sensor hole that is not needed in your 98. It's pretty simple to spot where the sensor hole is located when you can compare the heads side-by-side. In my case, my 93 engine still had the temp sensor threaded into the head so I just left it in there to block it off (unplugged of course).
I just swapped over everything that can unbolt from the 99 long-block onto the 93 long-block. Manifolds, accessory brackets, distributor and dizzy, plugs, wires etc etc etc. Upon close inspection, my 99 had slightly different engine mount brackets than the 93, so again, swap over everything that unbolts from the head/engine and bring it over to the replacement head/engine. There is nothing to consider regarding electronics (OBD-I to OBD-II etc) because you will be retaining as much as you can from the 98. This is a purely mechanical swap.
My 93 donor engine came from an auto-trans XJ. My 99 recipient XJ has a manual-trans. When the donor and recipient do not have the same tranny, then you need to get a new pilot bearing to match the recipient transmission. No biggie, you should probably get a new pilot bearing while you're in there anyway. Just buy a pilot bearing that was made for your 98. I didn't have the proper tool to pull the old pilot bearing, so I just used an old trick to get it out.. which is to pack the air-pocket behind the pilot bearing with grease and then find a rod that is the same diameter as the inside of the pilot bearing. Put the rod in the pilot bearing and whack the end of it with a hammer such that the grease pushes the pilot bearing out from behind.
My swap turned out perfectly and has been running well for months. I had never pulled an engine before this and I easily got it done during a long-weekend. I haven't noticed any difference in power. In my case, I do notice the 93 engine is slightly harsher/coarser and I think that's because the older (pre 96) engines didn't have the main crank girdle that was added to "eliminate noise, harshness, and vibration". If you drop the oil pan on both engines, you can swap the girdle from the 98 to the 94 engine so long as you also swap crank bolts as well (they are longer). As an FYI (not pertinent to the swap), the older engines (pre 96) having steel pistons whereas the 98 would have alloy pistons (might be why the newer engines peak torque is at 2k rpm vs 3k rpm for the older engines).
My 93 engine to 99 XJ swap was not that hard and there was very little to consider. Get new engine mounts while yer at it.
I'll try to attach some pics (not mine)...
girdle that you can swap from your 98 to the 94 (optional):
temp sensor that you no longer need:
pilot bearing (shown with flywheel on):