Try swapping the engine ecu imobilizer ring.round the barrel and ignition barrel.
If both cars have remote central locking swap the key fobs/remotes into the key that fits the barrel with the engine that has just been fitted.The chip for the ecu/imobilizer is in the keyfob/remote. Surely the airflow meter must have something to do with it????
It is a bit of a hard one this is.Im sure there is a compant called Shawspeed that specialises in the mk4/5 fiesta.