These old QM and GM series Yanmars are near indestructible.
If it still needs a silver back gorilla to crank it through a compression stroke, the engine should be good to keep in the boat.
I would check that the injection pump still pumps first, I.E that the drive gear for the pump is not sheared or broken.
You can do that by taking the injector lines off the top of the injector pump then cranking the engine and observing little squirts of diesel in a regular pattern popping out the top of the pump.
This of course requires that the fuel delivery has been properly bled of any air locks or leaks. If this test gives a positive result, the next step is to make sure the injectors are functioning correctly. Best place for that is a diesel injection workshop. They will recondition the nozzles or fit new ones as required.
A diesel engine is a "compression ignition engine" and therefore by definition if it has compression (25:1) and fuel at the right moment, it should run.
Beware of using Aero Start (Ramona's "start you bastard") which is usually ether, because for some reason yet to be determined, diesel engines can develop an addiction to it.
If you get to the point of having to take the head off one of these Yanmars, it virtually dictates a full rebuild as they are wet sleeve engines however a skilful mechanic may be able to pull the sleeves, delip and hone them, fit new rings to the pistons without having to touch the bottom end.
Yanmar parts are damned expensive but if you can keep the labour costs down by doing most of the work yourself it should cost less than a grand to do the above.
Further, these engines are that plentiful you could pick a good one up off Gumtree etc for $3,000 or less and you can justify your action as being your contribution towards conservation and recycling.
Couple of examples.
https://www.gumtree.com.au/s-ad/morisset/boat-accessories-parts/yanmar-marine-diesel-engine-3gm30f/1185578253www.gumtree.com.au/s-ad/madora-bay/boat-accessories-parts/yanmar-3qm30h-diesel-marine-yacht-motor/1182035305Many ex lifeboat engines around these days but I think $7,500 may be a bit rich.
www.gumtree.com.au/s-ad/currimundi/boat-accessories-parts/yanmar-marine-engines/1167223538Fitting a new engine different from the original can be a whole new ball game and could cost thousands.