I've changed the behavior of only button 3, the open hatch button, because with Comfort Access, I can open the hatch by grabbing its handle, so I don't need a fob button to do that. If you want to keep the default behavior of button 3 and change button 4, the U.S. panic alarm button, you should be able to do this as well.
BDC (Body Domain Controller)
Expert mode
30D0->RC_DEFAULT_IDG_3RD_BUTTON_LONG (open hatch button)
or
30D0->RC_DEFAULT_IDG_4TH_BUTTON_LONG (U.S. panic button)
set value to Wert_05 (open frunk)
HU_NBT (Head Unit)
Expert mode
Add remote buttons 3 and 4 menu to iDrive (button 3 can open frunk)
3000-> KEY_CONF_*: set all to active
3000-> KEY_CONF_TAILGATE_SMALL_NAME: set to frontgate (03)
3000-> KEY_CONF_TAILGATE_NAME: set to frontgate
I don't know whether changes to both the BDC and HU are necessary. Maybe just making the BDC changes is sufficient whereas making the HU changes adds menus to iDrive so the button behaviors could then be changed in iDrive.