If you don't have the information available at the "Outline scope" to determine what links to hide and show, then you'll have to find a way to fail gracefully when a file does not exist. Use some error checking in your agent and if the file does not exist, make sure the user gets a friendly message explaining what happened.
You say that you can't check if all files exists because there are too many, but just how many are we talking about? You may not be able to check them while the database is opening because you'll cause the user to wait too long, but perhaps you could cache the results somewhere. An agent that runs when the database opens could check for the cached list of existing files and use that to figure out which to hide. If the cached file doesn't exist, the agent could run a background agent to update the cache and store it on the server or within the database.
If you have some access to the server, you could also write a program that returns a list of existing files, and use that to feed your Notes database. Lots of options there, but for example you could have a PHP or an ASP.NET page that returns an XML list of files that exist on the server when you call it (or even something simpler than XML). Then again when you open the Notes database, your agent could call that URL, get the results, and go through the list of existing files to determine what links to hide.
Hope this helps!