Others have pretty much explained this as well as I could. The only thing I'll add is that while most State and Local jurisdictions will allow motor swaps and some even publish guidelines for it,
IF the vehicle is gray-market (i.e. not originally intended for sale in the USA), the Federal Government only allows you to swap an
identical engine, or an
EPA-certified engine.
No one's gonna want to hear this, but the same law that applies for getting a car through Customs (i.e. that it has the original, unmodified engine), applies for having it in the USA once it's here. To wit: When you import a gray-market car into the USA that is over 25 years old, the EPA grants you an
exemption as regards meeting US Federal Emissions requirements. Said exemption is conditioned on the car having it's original, unmodified engine. Those conditions don't change once the car is on US soil. Thus if you modify or change the motor, you lose the EPA exemption, and violate Federal law.
That said, Customs are likely the last people who will ever see the car and might give a tiny damn, so for all
practical purposes,
@coldtaco is correct. Most bureaucrats at the State level don't know or care about Federal law as it applies to gray-market vehicles, and wouldn't be in a position to enforce it if they did. And the Federal government doesn't really track what you do with your gray-market car once you have it here--they mostly leave that to the States.