I'm trying to do the same sort of thing, to switch between (for example) shot rotations for heroism and no-heroism. The additional haste speeds up the rotation, but with my hard-coded times between steps prevents any DPS gains. I'm thinking I'll virtualize the DPS rotation and use the heroism key to switch disable the normal rotation and enable the heroic rotation (with faster timing).
1. Ultimately, the target resolves to a slot. As I understand it, each slot is running a copy of the keymapper. Each keypress goes to 'self' which then interprets it according to the keymap. If a step refers to something other than 'self', the action is sent to the keymapper running on whichever slot(s) are required, which can then forward the action on to additional slots.
2. The keymapper on each slot should keep track of the step for that key. So, if you send 'x' to slot 1 it will advance to step 2. If you send 'x' to slot 2 twice, it will advance to step 3 and slot 1 will still be on step 2. It gets tricky when you are using 'self' since 'self' can refer to either slot, depending on which screen is active. I think of virtualization as hiding a mapped key. I believe the original key is still on the step it was on before being virtualized.
Note, you can turn on the debug console from the innerspace gui, enable virtualization and watch how each slot processes the keypresses.
Note, also if you have an key with no actions at all things don't seem to work right. I make all the 'dummy' keys:
step 1: set keymap/key to step 1
so none are empty. Otherwise I think the key gets optimized away and even virtualization doesn't work right.