Adding both the file path you are editing and an entry for $DERIVED_FILE_DIR into your output files for the matching file path will fix this issue without modifying User Script Sandboxing.