Please be suspect of any 240D that has engine problems...Hard starting on these engines is usually from low compression...
They are usually driven hard and put away wet.
My advice (for what it's worth) is unless the body is pristine, they are rarely worth an engine rebuild. It's really easy to throw a few thousand dollars into a rebuild and when you're done, the car will still be slow...0-60 in about 25 seconds even when new! An engine swap may be better.
These cars are so slow, that you have to plan your trip. If you live where there are long hills, be prepared to see headlights on your rear bumper...and big 18 wheelers passing you like you were stopped.
Don't ask me how I know...
The Tenor Man