'catch' your file open command, which will allow it to keep running even if that fails.
Example, (I didn't test this, but it's the general idea)
[codebox]string $path = "c:/bla/bla.ma";
int $caught = catch(eval("file -force -open \"" + $path + "\""));
if($caught)
warning ("File didn't open: " + $path)
else
{
// your code
}[/codebox]