The ‘pending restart’ inspector will return True if a BigFix action has flagged the system needs a restart (on Linux, we don’t check other places).
If your script is setting that file, you could make a Fixlet relevant by checking
exists file "/var/run/reboot-required"
You could have an Analysis return your results via something like
modification times of files "/var/run/reboot-required"