Hi,
I think you misunderstood, an fsm will use the local variable instead of the global if they are the same, so that is a rule you can implement in your scan, and so you can know all the actions that use global variables, by simply not counting the one that have the case mentionned above.
I have worked ( and trying to find time to finish this) on an introspection scanner that output all infos into an xml file, I think you could inspire on this. If you want I can send you an alpha package and check how it works.
Bye,
Jean