That's a good question because I'm now a little confused on that.
I seem to recall that my TJ's 231 that was originally bolted up to the original 5-speed transmission had a short shaft. I say that because when I converted the 5-speed to an automatic several years ago, the 231's input shaft was too short to seal inside the new automatic's shorter output shaft so it leaked ATF like a sieve. I had to install a longer/extended output shaft seal onto the automatic transmission to seal around the 231's short input shaft.
So I am confused at this point since you say your old 231 has a longer output shaft than the new one has... unless the 231 you received is for a completely different type of vehicle.
So I guess what I'm saying is that I'd probably swap the input shafts so the new 231 is using your old 231's input shaft.