It really is a crap shoot, and a pretty expensive one at that. When I bought my airplane, the engine (O-360) had about 930 hours on it, but in the last few years, the airplane had flown less than 10 hours between annuals. It was always hangared, in the Tulsa, OK, area, so a pretty dry climate. From all I could tell, I should have had another 1000 hours of relatively trouble free use.
Well, 15 hours from the time I left Tulsa, the engine threw a rod through the top of the case, and I landed in a field. A couple months later and $23,000, I had a "new" hand-built engine that now has about 960 hours on it, and except for some cylinder work on one of the cylinders a couple of years ago, has been pretty reliable. But why did that happen? The engine builder surmised that a bearing had spun, cutting off the oil supply, and that was probably caused by relatively little use between annuals.
Does that mean that every engine subjected to minimal use will crap out early? Not necessarily. My first airplane was a 1970 Skylane, which my pards and I bought in 1975 with all of 300 hours on it--all put on during the first two years, and the airplane then sat without being run at all for the next 3 years. That's a 1600 hour TBO engine (O-470). At about 1200 hours, i.e., 900 hours after we bought it, the cylinders needed to be topped. That was a mistake, because only about 150 hours later, we had to overhaul it completely. We would have saved some money if we'd just overhauled it at 1200 hours instead of waiting another year. So that engine probably suffered some from disuse, not nearly as bad as my Lycoming, but we still had 900 pretty trouble-free hours from it.
I have heard of others who bought barn-finds that hadn't been flown in 15-20 years, and all they had to do was change the oil and install a new battery, to begin what turned out to be several years of totally trouble-free operation.
So you never can tell for certain. And frankly, even an engine that has been run and frequently flown isn't guaranteed to keep running reliably. Stuff happens.
Cary