I bought a 240D with good engine and tranny, but the back of car was destroyed in a wreck. About a year or so later I ran across a little 240D with a seized engine.
I did the engine swap and it was fairly simple really. That is the way I would go. If the car is a good specimen I would buy it in a second. You are correct: they are expensive to rebuild.....

I'm guessing in your area you won't have to worry about rust......