Simplifying code is always good
I think the easiest way to do it with the current scorpion would be something along the lines of this:
Create a bunch of 1 frame animations, something like FX1-FX9 (the fact that they're in alphabetical order will be important)
Then, at the end of each animation, trigger a codeblock that does something like:
Roll dice with 9 sides
Play animation FX1 - 1 + Dice