So a couple of things, that will hopefully help you out here.
1 - We do return the current value of the "PendingFileRename" registry key as part of standard inventory as of 9.5, if memory serves. You can find it here:
==> Custom Data - Security Scan - Pending File Rename
BTW - it's located here:
HKLM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
It's one of the default registry bits we've added to our inventory scans, exactly because of issues like you're experiencing.
=============
2 - The key is populated by Windows - and pretty much any install can trigger it that requires access to files that are in use (Flash and Adobe can be a lot of "fun" in this regard, when people never close their browsers, which is why we've added a functionality to kill those processes).
=============
3 - If the registry value doesn't clear up, chances are some install keeps on trying & trying to finish, but files are always in use / locked, and thus you're stuck in a rut. In that case, examining the registry key in detail (and by finding out what files are affected, knowing what apps are causing you grief), and see what you can clear out.
A lot of times, these devices that "refuse to play ball" tend to have all manner of "fun" combos - ranging from over-happy AV's on a slow-specced device, causing lag-based timeout of the installers, and so on to "program X loading before program Y, and loading part of program Y in the process, thus locking program Y's update". All manner of "fun" stuff.
==============
4 - Do remember that you *DO* have the option to "continue even if reboot is pending" - which should be used with care. There's a reason why we make that an explicit checkbox in the agent behaviour.
Here's a screenshot from a 9.5 SP3 Core to help you along / focus:
=================
In regards to checking whether the flag clears - you can check the registry key (I've pointed it out to you) either by remote connection, by getting regular inventory scans (though these are not real-time, so be mindful of that).
You'll usually find (in my experience at any rate) that the clients that give you the most trouble tend to be those with a "checkered past" anyway, so their OS is on the verge of getting pooched and/or they're on their last legs - these sorts of things tend to go hand in hand more often than not.
Hope this helps.