Some TD5s are showing up with pretty high mileages these days and still working fine. With regular oil and filter changes some seem to go on and on, with 200,000 or 300,000 mile examples showing up.
Equally, people report having problems. Exhaust manifold studs breaking or stripping their threads, head gaskets blowing, that sort of thing. Oh, and the oil pump drive sprocket coming off so the engine gets starved of oil. The peripherals are a bit vulnerable too, with injector looms and fuel pressure regulators needing replacement fairly often on some people's cars. The injector washers and sealing rings seem to need replacement on some examples yet on others they remain trouble free for hundreds of thousands of miles. While we're on the subject of cylinder heads, another fault is cracks or porosity developing, especially where the injectors fit in the head.
As to what to do when the engine expires, if you really want to bend the plastic, have a look at the Turner Engineering website. Alternatively, secondhand units show up on Ebay ranging from a few hundred to over a thousand. One possibility is to get a secondhand one before the current engine fails and work your way through it replacing wear items like bearing shells, seals, piston rings etc. so it is ready to drop in when you need it.