in said scenario, PSN would faciltate the downloading of all required software before they close their doors. Its that simple. :)
digital downloads really have not been around long enough for you to know how the media available today will be available in the future, so you should shut your yap.
So, if you buy say, Flower or some weird digital game off PSN, and in 20 years there is no PSN, and the company who made Flower and Sony also shut down and didn't exist anymore, how are you going to get that digital download if all the companies you bought it from go extinct? Also, is there no expiration date for the stuff you buy?
So, actually it is complicated, since you don't know how it works either.
and after that?
who would be legally required to have digital media available for download FOREVER?Do you live forever? Are any of your physical games going to last forever? So why expect or ask such a meaningless question?