For practical purposes if the vendor can prove his statements it is practically a new engine. Your cars value if not very rusty is pretty good with that combination and probably worth the effort. On the otherhand a 240 with a blown engine will not bring much usually.
This all hinges on you doing the engine change yourself or fairly cheaply. At 100.00 per hour I would not touch it.
Maybe you can sell other components from the smashed 240d to further lower the overall cost as well. Another case where we should engineer a low oil pressure warning system and install it on the 123 series. There have been too many engines lost because of the lack of it.
What is considered a rusty car varies from location to location. I would preffer what is called a rusty car from arizona to one from maine for example. Description of the extent rust on yours might help as well.