Create a new generic CUPS wrapper backend /usr/lib/cups/backend/monitor that runs in parallel with the actual backend to monitor it.
It will continue to actively run in parallel as parent process of the actual backend (that could be e.g. /usr/lib/cups/backend/ipp) so that the 'monitor' backend can do whatever is needed to watch and control the actual backend including whatever is needed when the actual backend finished successfully or failed with an error.
The main difference compared to the 'beh' backend is that the 'monitor' backend is not idle waiting until the actual backend finished. The 'monitor' backend keeps actively running in parallel so that it can do whatever is needed to monitor and control the actual backend while it is running (e.g. the 'monitor' backend could terminate the actual backend when it is running for a too long time).
The generic basic idea behind is that the 'monitor' backend implements some kind of "generic admin robot" who is actively watching a print job while it is printing.
Because of that such a "generic admin robot" must be implemented in the native language for system administration: As bash script.
The intent is that experienced users and system admins can easily adapt or extend such a "generic CUPS backend monitor" bash script to make it work for their particular needs and use cases.