Speak to a few people who rebuild engines first, to get some insight. Then ask yourself a few questions:
1. How badly do you want to keep this car going forward?
2. How much do you trust whoever will rebuild the engine?
3. What is your budget? Get prices for the best case, the average case and the worst case (based on what they find once the engine is stripped).
An import engine is usually advertised as "low mileage", but that is only a claim. I have one now and have no idea what its real mileage is. It also needed a lot of maintenance. The sump had to be swapped because it's an X5 engine going into an E46 (otherwise the same engine), and the sump gasket on the import engine was hard and brittle.
That said, an import engine is still cheaper than a full, proper rebuild (unless you do the rebuild yourself).
Personally, if this were my car, I wouldn't put another N20B20 in. I'd go with the B48B20 if you want to stay at 2L, or the B58B30O0 3L if you can find one. The Bxx engines are far more reliable than the N20 era, and they're still BMW engines that were used in the
F22 series.
In Cape Town, LDR/TheEngineMen (where I got my engine) are a real importer and not one of the scams. It still isn't cheap, but a swap is more cost effective than a full rebuild.
I still don't know if my import engine works. I might see a video of it starting today. For me this is more of an experiment: I'm replacing a very tired 2.5L with a 3L. I still have two daily cars on the road (although they're thirsty on oil), so I have time to work through this third car's issues as they pop up.