Well in our case, because Sync is a native plug-in we created a hook that would wait/watch for the file to reappear before attempted further operations. For a script maybe set a timeout or check that the file exists / obtain a new variable containing it's location. ( i'm not sure what you're doing exactly or I could be more specific )
The crash log would be helpful. It may be an issue with the file temporarily being unavailable. When the files are saved they are removed and rewritten instead of updated. We had to do some trickery to work around this in Project Sync.
I have a post on aehancers but the traffic on there seems really quiet lately for some reason. I need to find a solution for a client but can't reproduce the error on my end.