1996 escort fast idle

We exchanged engines in our 1996 Escort wagon. We couldn’t keep it running more than a few minutes. Ford garage replaced fuel filter. We still cannot drive it because the throttle speed is over 3000. Engine codes are P1506 and 507. Have been told that it might need to have the engine “computer reset” due to changeing engines. Does that make sense? Any ideas?

The codes are for idle air controller (IAC) system failures. Have the IAC checked. Or better yet, swap it out of the old engine. It could be gunked up and wide open. Or just plain bad. The computer should have reset when the battery was disconnected for the engine swap. The day or more that would have taken would have allowed the memory in the computer to blank.