want to run two actions when pressing a hotkey
The most future-proof way to go about this is to create your own add-on. First create an operator that performs those actions. You can then bind that operator to the keyboard, add it as a button to a panel, add it to a menu, etc.

This is all documented in Blender's documentation.