In San Francisco, CA a replacement 2GM20F with 2 cylinders was quoted to me 1 year ago to be $15,500. A 3 cylinder is probably more. That is the largest cost. Check the standing rigging and all the systems for functionality. Recommend pricing out all the replacement items before you proceed, and then decide. Frankly, I enjoy fixing up a “tired” sailboat bit not one that requires an expensive engine replacement unless you get it for a great buy. I just completed a 12 month upgrade of a 87 Hunter with new port lenses, canvas, sails, life lines, rope clutches, batteries, navigation/radar system, running rigging, safety equipment, etc. and was fortunate the remaining systems, windows, engine, transmission, shaft, prop, packing gland, hull throughs, wiring, etc. did not require replacement. However, these upgrades still added up to a few boat bucks.