I think you're being hopeful about simply swapping an engine to make it compliant. The chances of that going smoothly and easily are very very slim, because unless you swap it 100% identical in every way from the original vehicle.....it simply will not be Euro4 compliant.
Manufacturers spend millions getting their stuff approved, and for each individual vehicle model.
And when you're going in a direction that may reduce tax etc......I'd say all parties involved will be fussy as fuck about it requiring various documentation that may be difficult to acquire.