Only for rename commands. (If it works at all for anything else, it's by accident and may not behave as you'd expect!)
The simple way is to have a .VBS file with your script and tell Opus to run that (passing whatever arguments you like; e.g. the current path or selected files).
A more complex way, which avoids having the separate .VBS file, is to abuse the rename scripting feature to run a script that doesn't really rename anything.
I'd start with the simple way, then convert it to the other way once you have it working, if you don't want the .vbs file.
Within the script, you can run Opus commands (like CreateFolder) by executing dopusrt.exe (in the Opus program files dir) with the /cmd argument. e.g.:
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /cmd CreateFolder READAUTO=no NAME="coll://Collection Name"