A 4.0 swap is sort of easy. Since it's the same basic engine (just a newer generation) as the 256, it bolts right in with new motor mounts that bolt up to the frame in place of the mounts that are on there now. If you do get a 4.0 you absolutely want to get the entire wiring harness intact from the donor vehicle. If you have to hack together a replacement your life will be hell.
As long as you're getting the 4.0 out of a donor vehicle, it makes sense to grab the transmission with it, especially if it's a manual. That is, as long as it's not the Peugeot 5 speed from a late 80's/early 90's YJ. What you want is the AX-15 or NV3550. All you need is a custom hose to adapt the CJ clutch master cylinder to the slave inside the bellhousing of the replacement transmission.
The donor will have a transfer case that drops on the wrong side but that's not a huge problem. Just use a different case. Don't quote me but I think the Dana 300 that you have in the CJ will bolt right up to the replacement transmission without an adapter. You will have to make sure you have the right spline count between the transmission and transfer case. Some had 21 splines, others had 23. Getting that sorted out won't be too hard. Novak and Advanced Adapters have everything you need to make that work.
The biggest deal may just be getting the rear transmission mount to fit. If you can fabricate with metal it's easy. If you have to pay someone, it shouldn't be too much.
I don't think you'll really need a speed sensor to drive the computer for the 4.0 since it's a manual but I could be wrong. I think the sensor is only needed to drive the electronic speedometer that you won't have. It's not hard to have a speed sensor at the transfer case and still run the cable for the manual speedometer.
One option while you're working on the swap is to do a 4.0 stroker motor. When Jeep went from the 258 to the 4.0, they shortened the stroke but increased the bore. A lot of people take the crank from the 258 and put it in their 4.0 when they rebuild. They end up with a 4.6 liter. If you get a kit with the crank, a cam and a computer retune, you can add a good 50% to the horsepower and still get better mileage than stock (if you keep your foot out of it).
For the Chevy 4.3 or V8 swap, there is about the same amount of work. You can get bolt in motor mounts from several places. If you get a fuel injected donor and get the entire wiring harness, that end is basically the same as swapping over the 4.0. If you stay carbureted, keep the factory Quadrajet since it's a great off road carburetor. You'll just have to work out the few basic wires (choke heater, oil pressure sender, temp sender, etc.) and you're done.
Again, your life will be much easier if you get the transmission to go along with the engine. The engine will probably have the 700R4/4L60(E) automatic. Adding an aftermarket shifter is easy since there are so many out there. The manual transmission will probably be an NV3500 or NV4500 depending on the donor. The clutch will adapt the same way as the Jeep manual. Adapting these transmissions to your Dana 300 will require more work since the Chevy uses a 27 spline output shaft and the bolt pattern on the adapter is rotated to a different angle on the Chevy. But again, Novak and Advance Adapters both have everything you need to make the swap. Though if you get your donor from an 80's model pickup it will come with a passenger side drop transfer case that you can use (with maybe a slip yoke eliminator) instead of the D300. In the late 80's GM switched to a drivers side drop (though the K5 Blazer ran through 91 with a passenger side).
Edit: Forgot to add. Once you get your engine and transmission figured out and you know how you're going to be using the Jeep, you'll know what RPM ranges you'll want to be in as you drive. You can use a gear ratio calculator
to figure out what gears you'll want to run in your axles to match your tires. And, depending on what size tires you want to run, you'll know whether or not you need to upgrade your axles.