The 4.0 head has a better port design than the 258. That's the main difference. I'm not sure if it changes the compression or not. You will probably have to plug some of the water passages and you have to use the 4.0 exhaust manifold.
'86 CJ7, 258 w/Mopar MPI, 4.56 gears, rear Detroit/front Truetrac, full cage, OBA, 8274, 4" lift via Alcans/Rancho, 35's on beadlocks, other stuff. Built for rocks, mud is a four letter word.