If you can find an A&P friend, it will cut costs considerably. I think the parts and machine shop costs to overhaul my IO-540 was around $12,000 with new Milleniums etc., but I didn't pay myself anything.
The external appliances, vacuumn pump, Alt., starter, yes even the mags and ignition harness don't have to be replaced. It's nice to if money is no object because it pretty much ensures a trouble free engine for many years, but if you can't afford it, spend the money on the engine internals and scrimp on the externals. It's a whole easier to replace a mag than a cam.
It's possible to lose the case or crank, be prepared. Send the case off to be inspected, repaired and re-alodined, send the crank and cam and rods off too. Replace the cylinders if possible.
I think with a little luck and help from an A&P, you can do it for $10,000 or so.