In 5.499 alpha I finally got around and added a native trigger that is monitoring this database based on @fortred2 's code. There is a small delay because the system doesn't immediately write the database to file.
This also makes the last shown notifications available as JSON string via variable BTTLastShownMacOSUserNotifications
Example of that variable:
[
{
"app" : "com.apple.ScriptEditor2",
"title" : "",
"subtitle" : "",
"body" : "Zipping app for notarization..."
},
{
"app" : "com.apple.ScriptEditor2",
"subtitle" : "",
"title" : "",
"body" : "Uploading for notarization..."
}
]
(the JSON can contain multiple notifications due to the delay mentioned above)