When you register events in your macro, you will be specifying a callback function. This is where you would evaluate the type. However, judging from how you've described its desired behavior, I'm suspecting that you want to do this with a macro when you would probably be better served with an add-in.
You could write a macro that would just "wait" using a DoEvents loop and register triggers to it - but it would be clunky. You would also have to remember to run it at the start of each Solidworks session. Meanwhile, an add-in can be toggled by the user and even be configured to launch automatically on startup.