Just reread this end to end
1) You need to confirm fuel pressure and flow capacity is still there to maintain higher engine rpms. Pumps go bad right off the shelf, and fuel lines in the tank come loose.
2) It sounds more and more like exactly what I had last year, The shear pin on the gear at the bottom of of my Distributor shaft was loose (finally broke, sheared off) and I could spin the rotor around by hand. There should be no rotational play in the rotor turning it by hand.
Mine had a bout 3/8" side to side just before it broke.
Second the distributor you have may need indexing, I even had to cut the location ear off of mine on the brand new one, like so many others here to index the new one as it was defective off the shelf new, because of OEM Factory Cam shaft mistakes over the years by AMC-Jeep on these jeeps. Did you say you replaced the engine? Distributor?
See if the rotor on the distributor can be rotated rationally or if it has any side to side play in the shaft (bad bearings). If it has more than 1/8" in rotational SLOP, or any side to side play replace it.
Either way, take a used cap and make a cut away view window and follow cruiser54's Indexing the distributor instructions on his website blog. There are no short cuts to his instructions, LOL, I tried. Buy a new cap and rotor and used the old one for making the window Cap tool. Makes the indexing super precise!!! And that makes a huge difference. Contrary to urban legends, the ECU can not compensate for a spark jumping the wrong plugs!!!