For the first part I don't know if the 4.2 and a 4.0 have the same bolt pattern to match transmissions, hopefully some one could answer that, the 91's also came with a 2.5L as well.
The 99 4.0 will have a few up grades that you 91 didn't have, The Crank case position sensor ,Cam Shaft position sensor,Throttle body sensor and Mass air sensor, ect ect. So you will need to pull the 99's Electronic Control Module and the motor compartment wiring harness with all of its sensors hook ups.
You will have to have the ECM re-flashed due to the fact that the Grand Cherokee came with 4 wheel ABS and your 91 didn't come with this option, power monitors on the wiring harness for tail lights and other low voltage reading off the wire harness.
Don't quote me but a good automotive electrical shop should be able to tell you, if you can piece in a 99's wranglers motor compartment and ECM to drive the 99's ZJ's 4.0 .
Another sorce for the wiring is
Painless wiring, there tech help should be able to tell you how much re-wiring you will need to do.
Now you will need to change your fuel pump due to the fact that you need a return line from the fuel rail.
Plus dont forget to grab the 99's exhaust cross over tube so you can get the O2 sensor bung.