I'm sure you won't be surprised to hear that it requires custom ASM. The way the script runner is built, you physically cannot use commands with an index greater than 0xFF, because a script command's ID can only be a byte in size.
What I did was turn command 0xFF into a command which takes 1 parameter, that parameter being the "extended script ID".
The code reads the ID, and then jumps (in ASM) to the code associated with the ID based on a table built into command 0xFF. It then executes as normal. If the extended ID command has parameters, these parameters follow on directly from the extended script ID, as they would in any normal circumstances.
Basically, command 0xFF in my ROM is a bit like Callstd in overworld scripting.