That seems a bit over-complicated. I'd maintain 2 sets of auto-configurations for the gamepads - one having a hotkey and the others without it - and switch between them by modifying the auto-config folder where RetroArch looks for the gamepad .cfg files, that folder is set in the main retroarch.cfg file.