Your script could use insert file to temporarily insert the file into a container field (don't select store by reference). This can be a global field if you want.
The next step would be to use Export Field Contents to export the file to it's desired new location.
Then use Insert File again, this time to insert it by reference to insert it from the new location.
You'll probably need to use a variable and some get functions to compute the path and file name of this file.