I've just realized why it is not at all odd that (as I said in message 9) "...no matter what you do, application files are always active..."
The reason is that they are returned to ExtendScript as folders, not files, so my previous code that explicitly tested for files with a .app extension was on the right track but in the wrong place. If you want to exclude applications, you need to add logic to the folder detection code, returning false if the folder name ends in .app.
You can check this by running:
#target indesign
alert(app.fullName.constructor.name)
It displays an alert that says Folder.
Dave