Depending on the size of the engine, ie not a big 4 pot, you can take it on a plane as checked in luggage but it would have to be spotlessley clean, no oil dripping out and in a stronge containe that can be carried, you will have to pay the excess baggage charge and it would have to go with the over weight luggage.
A friend of mine brought a VW campervan gearbox and drive shafts back to the UK from the States as hand luggage a few years ago with no problems, but i know time's change.
As for engine number you can get a customs deleration which will have the new engine number on it and is stamped and signned by them or you can send your Carnet back and have it ammended with the new number, I think they can also send you a letter that go's in the carnet to say you have change a part, ie the engine. Or you could just put your old number on the new engine. There is all ways away hope this of some help. Skip
Do the best you can with what you have,
A stranger in a strange land now heading North South East West to.....