Well, there's no such trigger of course, so this doesn't seem like it will be easy to accomplish.
I think the best you can do is call a policy normally, but use a Before script that loops and checks to see if someone is logged in and their screen is unlocked, and when that condition occurs, continue with whatever it is you're trying to accomplish. But this means keeping a policy "running" for, in some cases, an extended period of time, which isn't really a great idea I think.
In case this helps, there's a post here that has a helpful script for detecting if the screen is locked/unlocked. (not the python one, since python is now deprecated)