So your problem is to find a suitable file manager on any linux box.
It seems xdg-open will do what you want. On my machine it opens dolphin if I call "xdg-open ."
There also might be methods to find standard applications in window managers like gnome or kde, but I'm just guessing. Probably they just use xdg-open too
If nothing works you could have a list of filemanagers in your script that you simply check if they are installed.