I just got back from having Saturday breakfast with a former racing friend. He just rebuilt a 6-cylinder engine (not a Jeep) for his brother's truck. He showed me the bill from the machine shop. The cost just for machine shop work as about $1300.
That included new cam bearings, but nothing else. It was bored .040 over to clean up the bores, which means the rebuild will require new pistons as well as rings and bearings, cam kit, seals, timing chain, etc.
Expect the cost for the engine to be around $2500 to $3000 excluding assembly labor by the time he's done. That's just the engine. Then there's the time a shop would charge to remove and replace the engine. Depending on whether he shop knows Cherokees or not, estimate two to three days for that. Yes, it can be done in a day by someone who knows whet he's doing and really pushes, but in estimating it's not wise to count on that.