I made a mod a while back that lets you create keybinds with custom commands or even entire scripts.
https://blocklandglass.com/addons/addon.php?id=183If you don't want it to be persistent and just want a quick keybind now, you would use something like the following:
$remapdivision[$remapcount] = "my keybind section"
$remapname[$remapcount] = "my keybind";
$remapcmd[$remapcount] = "function_to_call";
$remapcount++;
function function_to_call(%pressed) { ... }
Then you can bind it to a key in the options menu