What is in the "Code:" field is what you should have in your action list.
Part of what is shown is the action itself, but three of the four entries also show what would be in one of the fields of that action's configuration dialog.
What the example command would do, is set a text variable named "~key", to literal text that forms a variable hotkey indicator, E.G., as you mentioned "ARROWD".
It does this by using the "{TXTSUBSTR:}" token to get the first letter (starting at position 0, retrieving 1 character) of the phrase that was spoken to trigger the command, which is supplied by the "{CMD}" token.
As is mentioned in the second linked topic, tokens are replaced by literal text, and they can be used to partially or entirely substitute literal text.
This is used to combine the literal text "[ARROW", with the output of the tokens (E.G. "d"; variable hotkey indicators are not case-sensitive, so there's no need to convert to uppercase), followed by the literal text "]"
E.G. if you speak "down arrow 1 times", the contents of "~key" would be "[ARROWd]"
The keypress action should then retrieve the value of that text variable named "~key".