I don't see why any button needs to be mapped to the TAB key. TAB doesn't appear to be used anywhere in the menus. Am I missing something?
The physical key Tab is by default mapped to traverse the button selection (in the bottom area) in retropie's dialogs. More generally it is mapped to traverse the input fields/controls of the different widgets available in a dialog.
For 0x0a / 0x0d: I do not stick to 0x0a I just took what was there, maybe it is the cleanest to sent the terminfo's cr instead of 0x0a or 0x0d.