Made it into an action block.
Note that the macro that I made only gathers runtime permissions. One of the action blocks I made also gathers install permissions so it might be more appropriate to use both of these 2 dictionaries that action blocks return.
So now just run the action block every 10 minutes or so, iterate over the runtime permissions and install permissions dictionaries and if the key is false post notification about permission from key being revoked.
EDIT: I found out that only granted permissions will list in install permissions, so it doesn't make any sense to save granted state of these permissions. This means that all permissions listed under install permissions are granted and, permissions that aren't listed granted aren't. Hovewer this is not the case with runtime permission that will get listed even if I revoke them.