...then I get an error:
But if I set the Standard Function editing mode for the script and save it, no error is generated:
Please, fix the new Script Function editing mode for using with embedded rename scripts.
I'm using Opus 12.6 (evatuation)
This is not a bug.
Rename commands are run via Standard Function mode, as with any other internal commands. You can also put a rename script after the commands if you want to use one.
Script Functions run scripts, ONLY. You can't have a Copy or Rename or other internal command at the top of a script. (Scripts can run internal commands via the Command object, but you can't just out the raw commands at the top of the script.)
If it seems weird, it's because at one point there were no Script Functions and the Rename command was a special case. (It still is a special case in that it's an internal command which can run a script, while usually it's the other way around.)