AFAIK, there’s no such option. Also, I believe currently all events are triggered only after the actual event has happened, which is a huge lack of the before{Event}
feature. It was mentioned already and there are plenty of use cases, but it never got any attention.
In your case you might listen to the document close event. Not sure, but it might be triggered if Ps is being closed with some documents still open