Hi, thanks for your reply!
Well, if everything worked on just key codes, this would work out of the box (but showing the wrong letter in the GUI). However, this is not the case. Picking the correct letter works as expected, but Alfred maps it to the wrong key code (presumably choosing the mapping from Qwerty instead of Dvorak). Are you saying Alfred only gets a key code from OS X when a shortcut is created, and maps it itself to a letter to display? If that is the case, that mapping should be done with the currently selected layout and not Qwerty.
Cheers,
Adam