I don't think it would need to be that complicated.
My Pseudo Code:
if(app supports this devices version of iOS)
then make update available for download
update is not available for download
The device already knows which version of iOS it has on it, so the device itself wouldn't need to be considered really. Even if it is a whole heck of a lot more complicated than that(which I'm sure it is to some degree) it's not like Apple doesn't have the human resources to make it happen. It's a very common bit of functionality to see on the web, so from a technical perspective I really think they should already have this type of functionality built in to their ecosystem.
OTOH I've noticed a number of things in Apple's ecosystem, in recent years, that are geared towards pushing people to upgrade their hardware and software. Like Marks current situation: if he wants this app to run, Apple apparently thinks he should buy a newer iPod so the latest version of the app will run. They stand to lose out on profits if they didn't push you away from running older versions of the app on your old device. They are
like any other corporation that made it big.