You can change a keybind of a button but you can't switch spells that are there. At least not that I know of.

/run SetBinding("F1","MACRO MyMacroName")SaveBindings(2)
That would set your F1 keybind to that named macro.

I think that would be a pain though and hopefully you can figure out a different way to do it. Possibly a FTL assist macro.