I did the 4.0 head swap on my 87 258. I ended up putting my ported and polished 258 head back on. There was no 40 hp increase, just a little better topend. The 258 head keeps my peak torque in the lower rpm range better than the 4.0 head. The 4.0 head may work better with FI, or is better on the highway at higher speeds, but the 258 head responds better off road at a crawl and lower speeds. I have a holley TA 470 4 barrel, offy intake, comp cam, rollor rockers, (now) ported head, hipo pistons, header, HEI, and MSD. The 258 head worked better with this setup. The 4.0 head pulled a little better in the higher rpm range, but lost a little lowend where I tend to operate when wheeling. With the ported 258 head, it's still very fast on the street and has awesome lowend torque when off road. I paid over 400.00$ from clear water for the 4.0 head -vs- 250.00$ to port the 258 head. Just wanted to share my experience before you did the swap. You gain a little at the top, but lose some at the bottom, at least with a carb as you don't have a computer to make any kind of corrections. Not saying don't do it, but there is no 40 hp as have been sugested and you lose some lowend.
1987 wrangler, 258 I-6, 5-speed.
2007 liberty sport 4X4, automatic
2009 ford ranger 4x4 FX4 OFF/ROAD, 5-speed