The AW4 would be a pretty long transmission in a YJ, unless you're planning on extending the wheelbase in the rear. You'll be limiting your lift options or facing severe driveshaft angle issues. An extremely short SYE or a shorter transfer case would be possible solutions. You'd be better off using a 32RH, which was the automatic transmission that was offer from the factory in YJs. It's a TF999 with a provision for a CPS. It's a great transmission. I prefer it to the AW4. It's also a much easier swap, since the transmission is not electronically controlled.
To swap in the AW4 you'll have to splice it's wiring harness into your YJ wiring harness, since the AW4 is electronically controlled it needs a TCU, and input from several of the vehicle's other sensors.