The reason for my question... there is potentially large valuation difference between an engine that was overhauled 5 years ago vs. say 25. Not that either is necessarily unairworthy.
There are a couple of potential pitfalls when an engine has not been flown regularly.
1) Corrosion.
The coating of oil on some engine surfaces, most notably the cam lobes and the cylinder bores, is lost after 3-4 weeks of non operation.
Corrosion on the cylinder walls is the lesser of the evils but if it is significant it will increase oil consumption and blowby, and can cause piston ring issues. Engines that have been run regularly in service for 50 or so hours tend to have a varish on the cylinder that helps prevent corrosion and in a dry climate that can be sufficient to protect them for several weeks.
Corrosion on the cam lobes is big fear as they are face hardened for wear resistance, and if that hard outer surface is compromised by a pit from corrosion, it will start to spall or flake off. You can't just pull a pushrod and inspect the cam lobe on most Lycoming engines, so it's hard to detect unless you pull a cylinder, and removing a cylinder is expensive, and has a whole host of potential risks, such as not getting a proper preload on the studs and through bolts when re-installing it, which can result in losing a cylinder in flight.
There are some things that help protect the engine.
Straight weight mineral oil does a better job of protecting internal surfaces on infrequently flown engines than multiweight oils that use a 15W base.
Cam Guard or oils like Aeroshell 100 Plus with similar additive packages also help reduce the potential for corrosion.
Running the engine on the ground doesn't usually get the oil up to the 180 degrees or so it needs to eliminate fuel and water that get in the oil through condensation and from priming the engine. Water aids corrosion and fuel in the oil increases the acidity, which also causes corrosion issues. The aircraft really needs to be flown for at least 30 minutes at least monthly for optimum health.
A dry climate will go a long way toward preventing problems in unflown, or infrequently flown engines. If the humidity seldom gets about 30% corrosion is usually not an issue.
Storage in a hangar also helps as it greatly reduces the daily temperature changes and potential for condensation in the engine.
If an engine is flown seasonally, and stored for more than a month, it should be stored with a fresh oil change using an oil like Shell 2XN, or Shell 2XN fluid mixed with Aeroshell 100. The latter can be flown, but not more than 50 hours per TBO cycle, the former should be changed before you fly the aircraft.
If a horizontally opposed engine is pickled long term, it's usually filled with a preservative oil and then stored inverted so the cam is submerged in oil. All the openings are covered and desiccant plugs are placed in each cylinder. If really done right it'll be sealed in plastic, with either dry nitrogen, or vacuum packed and then crated to protect the sealed bag. The military used to pickle small engines in airtight sealed cans and they'd store safely for decades in that condition.
2) Engine AD compliance
If an engine has gaps in it's airworthiness you can run into issues with old ADs where components needed to be changed out after either so many hours or after a calendar limit. Engine accessories can be affected, and some non Lycoming, non Continental cylinders have been subject to replacement requirements over the years. Check to engine logs and the information on the last overhaul very carefully so you know what you might be getting into.
Manufacturers will usually have a suggested calendar limit between overhauls, such as 12 years. However on a 2000 hour or 2400 hour TBO that's 167 to 200 hours per year, and not likely to be met by the average owner. Consequently, finding engines overhauled well over 15-20 years ago is common, and not really an issue if it's flown regularly and maintained in airworthy status.
-----
Properly maintained and flown monthly, even just for 30 minutes (6 hours per year), would be enough to prevent any significant issues. It's a lot less about the time per year and more about the gaps in between flights, as well as the climate and storage conditions. For example, I used to own a PA-12 that had been stored in a hangar on a ranch for over 20 years without flying. The O-235 engine had 900 hours on it before it was stored and had no corrosion issues when we got the plane airworthy. But it was hangared and in a dry climate. That same engine in an aircraft stored outside on a ramp in Florida would probably have issues after 2-3 months.