One general suggestion: It might be better to use a normal script rather than a rename script for this. I don't think the rename command can move files across devices. Rename scripts also don't have access to the lister window property so, if they show dialogs, the dialog will not have its parent window set properly.
So I'd do this slightly differently, in a button script. You can loop through the selected files, and for each one run a command which moves them to a determined folder. My Merge Folders script has most of the building blocks you'll need. It moves everything to a single folder, which isn't what you want, but just after that it loops through the selected folders and runs a delete command on the empty ones, which shows how you can loop through the selected items and run commands on them individually. The command object you get has all selected items attached to it initially, which is why the RunCommand Copy line affects all files, but you can also call cmd.ClearFiles and then add individual items to run commands that only affect them, as it does after that.