IMO that's a very unfortunate default behavior - the files in /tmp are *your* working files, and nobody has the right to delete them without notice during the current session. Personally I would disable that "feature" immediately. That's why I don't like OS X - I want to have full control.
The solution to this problem, besides disabling the script in question (personally I'd remove it forever), is selecting a different swap directory in PixInsight:
- From the main menu, select Edit > Global Preferences.
- On the Preferences tool, select the Directories and Network section.
- In Swap storage directories, remove the default /tmp entry.
- Click Add and select a different directory.
- Press F6 or click the round button to apply globally.
or move it's swap file storage to someplace safe, like ~/Library
The logical place to store temporary files is /tmp. That's the purpose of /tmp after all. Having to use another directory for temporary storage because there is a script deleting temporary files just because they haven't been accessed in a while is a complete nonsense in my opinion.