Is there a way to use plugging in a second monitor to my MacBook Pro via the hdmi port as a trigger?
Currently no, not directly. Screen configuration changes are not a trigger.
ControlPlane might be able to detect it and then you could trigger a macro from that.
Alternatively, you would either need to run a macro periodically (but it would probably have to be quite a fast period which would be relatively expensive in terms of battery usage etc), or trigger the macro yourself by some other means (such as the status menu).