it's not only the engine, that makes the difference between "Z$ 2,5" and "Z4 3.0". There are also the rear axle differential, the gearbox and several parts.
The difference in the the price is only ca. 2000 Euro / Dollar.
If you would change only the engine, you can't drive faster when 235 km/h, the engine rotation is tooo high cause of the gearbox and the rear axle differential.
You are better in selling the 2.5 and buy a 3.0
regards, Jokin