Actually, this issue cannot be overthought. The plane that is purchased will have to be lived with or, if not, sold to get something else. Other than the usual host of questions about the mechanical condition of the candidate plane for purchase, and the cost of power-plant/propeller overhaul and inspection certification, will be the cost to bring the plane to FAA compliance. All of this seems to be set on the cost of operation as an ultimate deciding factor. The question always seems to come down to the following; can the plane of choice be bought, maintained, certified, and flown at a reasonable cost.
Within a broad perspective, the overall most important issue in purchasing a plane generally seems to involve the cost of operation. The dilemma that was mentioned should be viewed from the perspective of G100UL aviation fuel, details of which can be viewed here. In July of 2021 the FAA approved Supplemental Type Certificates (STCs) authorizing use of G100UL high-octane unleaded avgas in aircraft piston engines, without modification. At least this is something to consider, in the foreseeable future piston-engine aircraft are not likely to be rendered unserviceable due to the unavailability of leaded avgas, or the need to modify engines to use unleaded G100UL fuel.
Given this view, a perspective of the future of piston aircraft would be that they will not be likely rendered obsolete within a relatively short period of time, but, if they are FAA compliant, will retain their value and remain viable for a rather considerable time. There are no other alternative energy packages that have a similar or greater energy content per unit mass as does avgas in the operation of current-technology piston engines. Consequently, the purchase of a piston powered aircraft will likely remain viable for the intended period of use, at the end of which time the plane will be sold.
Also, keep in mind that retrofitting an aircraft of current design for a new type of power plant, say battery-electric, will be a "big hairy deal" should the power-to-mass ratio of batteries become viable for the required longer operational range of flight that will be demanded of such aircraft. Certifying a piston aircraft for such a conversion is not likely to be easy, or even considered rational, particularly regarding the safety issues, rebalancing, and wing-loading issues that must be overcome to keep the aircraft stable and flyable. In view of this issue alone, piston-powered aircraft in their current state of design and use are likely to be around a very long time, especially when unleaded avgas is available. Or at least, that is the way things seem at the present time.