You are right firescue17, sending the correct key with hold off to a slot that did not receive the key release event does correct the situation. The problem then becomes how can we send the correct key at the correct time?
I tried a few things, and while I was getting close to a pretty good solution as far as behavior, the implementation in ISBOXER was growing quite complex and very messy so I decided to try from of a different angle.
My new solution:
My modifier (mouse5) no longer activates a keymap for my movement keys, rather it populates the FFXIV-Movement ATG with "all other slots" on press and with "current slot" on release. So FFXIV-Movement has normally one slot in it, but contains the other three when mouse5 is pressed. This is pretty flexible because I can now define other keys to add whichever slots I want to FFXIV-Movement and everything else works correctly (e.g. if i add all slots to FFXIV-Movement, evey characters will respond).
I know have a keymap, also called FFXIV-Movement, that is loaded from the start. This keymap has my movement keys (held) that send the corresponding keypresses to the FFXIV-Movement ATG. In my previous post I mentioned that being able to trigger actions from press or release on held keys would be useful. It turns that we can do it! Just a little indirectly.
In addition to my movement mapped key (held) I have duplicate mapped keys with hold off set to the same hotkey. For instance, pressing D, will trigger my Back mapped key (with hold ON) that sends the D key to the game. Pressing D also triggers my other mapped key which has two steps, one for press, one for release. On press it keeps a copy of the FFXIV-Movement ATG in its own ATG. This records the target slots that received the key down event. On release, the mapped key sends its associated key (e.g D) to its private ATG. So even if the FFXIV-Movement ATG has changed, which means the key release event will not be sent to the correct slots by the "held" mapped key, the new key press/release will go to the correct slots.
So for these mapped keys to work I need 5 ATG (FFXIV-Movement, FFXIV-Movement-Left, FFXIV-Movement-Forward, FFXIV-Movement-Right, FFXIV-Movement-Left, FFXIV-Movement-Back). They are all empty at the start. One final detail is that on my focus slots mapped keys, I have to make sure to set the new foreground slot in my FFXIV-Movement ATG.
With this I can now press my movement keys and mouse modifier key in pretty much any order without anything breaking. Movement keys remain in effect until released which is pretty intuitive. This also works well with multiple movement keys pressed at the same time.
I haven't done extensive testing, but so far it seems pretty robust with no stuck keys or strange behavior.
Here are my keymaps that implement all this:
http://www.privatepaste.com/6d12d610c8 FFXIV-Movement : This has all the movement keys. The ones named "- PR" are implementing the press/release logic.
http://www.privatepaste.com/7bffd5ebe1 FFXIV-Non-Combat: The interesting mapped key is Mouse 5 Modifier, it shows how I keep the FFXIV-Movement ATG populated.
Thanks again for your help firescue17.