Well, the theory would be, bought cheap (<$40,000).
Well, you've probably heard this before, but...
It is really hard to find seaworthy boats in that size range for less than $40k. When you do, it is probably behind the power curve for maintenance and will cost you significantly to get squared away.
Even doing the work yourself, so much costs money. Marine paints and varnishes can be dozens to hundreds of dollars a gallon. Marine wire can be dollars per foot. This part. That part. Etc. It just adds up.
I just bought one for $33500. It looked beautiful inside and out. Newly rebuilt engines. Newly rewired. New bottom paint. New HVAC units. Etc.
But, it is, as was expected, taking tons of money. Thousands of dollars into it since buying it -- and it probably looks little different to a buyer (or, sadly, to many surveyors).
Some were obvious things. Thousands on the generator (needed stator), inverter (didn't have one), hot water heater (bad), radar (not working), windlass (reported working, but not)
But, some didn't stand out -- even on the survey. The things between the big things still needed done. Hundreds on wiring and related things to get it (to code(-ish). Batteries and battery boxes. More than $1k on strainers and related plumbing parts for the engines. A thru-hull or two. Various water valves. Portholes and hatches. Gauges. Senders. Decks/non-skid. Pumps. Throwables. Life jackets. Fire extinguishers. Smoke/CO alarms. Refrigerator thermostat. Etc. Etc. Etc. You get the idea.
I have come to the idea that there are basically 3 classes of boats: Those that are used dock-size (liveaboards, weekend condos, entertaining boats, etc), those that cruise very locally (around the bay/harbor boats), and those that are used in open water. If I was looking at sail boats, I probably would have added a 4th category for those that are used for truly long-range/global travels.
I came to the conclusion that boats are most often not maintained for their design purpose, but for their present purpose. So, it is likely to be relatively modest to buy a boat and continue to maintain it for the same purpose as the prior owner. But, it is going to be very, very expensive to get it up to a more intense class of use, and even more so, the longer it has been used however it has.
For example, a liveaboard probably doesn't worry much about the engines. Maybe they run them once in a while. But, they don't get loaded. The coolers don't get checked. The fluids rarely get changed, etc.
The local user makes sure things run. But, if something leaks a bit, well tightens it up or cleans it up. Etc. If something actually breaks, they'll fix exactly that dockside, later. No big deal. If in it was an important part, that's what towing service is for, right?
The cruiser who wants everything to be reliable. It has to be reliable. Who wants to be stranded between Ft Lauderdale and the Bahamas? Or half way to Catalina on a windy day? If something overheats because a cooler is clogged, that's a problem. Same if coolant leaks out half way. Diesel leak? Can't close the valves when underway. And don't want any fuel in the bilge when checking into a new marina or the USCG says hello for an inspection. All these things need to be right. The coastal cruiser who is going to be far from home? Even more so. Things are harder to fix when you don't have the local knowledge at the home port.
So, that bargain $25k boat that has been a liveaboard for years? It might be a bargain for another liveaboard. But, it likely isn't a good deal if the intended use is coastal cruising. One would do better to buy a boat that is already cruising the coast.
Basically, I'd strongly advise against buying a boat currently in one "class" of use and trying to upgrade it to another "class" of use. And, more strongly so the longer it has been used as it has.
I think the best idea is to buy a boat being used the way you intend to use it, and pick up where the old owner left off on maintenance in the life cycle, or (as I am) make upgrades within the "class" of use.
I'm doing much better financially w.r.t. money being put into the boat vs boat value, and the predictability of the budget this way than I did on my last boat which was a "bargain" liveaboard when I bought it, but left me with, well, some surprisingly large bills on the way to making it a reliable coastal cruiser.