You're not saving your bindings. On login, and when opening the keybinding UI, it loads your current binding set using LoadBindings(set), where set is:
Code:
DEFAULT_BINDINGS (0)
ACCOUNT_BINDINGS (1)
CHARACTER_BINDINGS (2)
In order to make your bindings stay in place across sessions, you have to use SaveBindings(set).
Alternatively, if you don't want to permanently store your bindings, run your code in response to the
UPDATE_BINDINGS event.