I'm not aware of any way to listen for a keypress that's been exposed to scripting. There might be a way to do it through hacking the UI (see FollowTheGord's user page for links) or you could create a custom ability and pop it the first 12 slots of your quick-bar.
There is a reference category in the wiki which includes the functions category. Broken functions should be flagged with the broken functions category when they are discovered however I suspect there are more than the five listed there.
Not sure what you are looking for in terms of "global variables". If you are talking about settings or configuration you might want to look at the INI file or one of the many 2DA files. If you are talking about scripting then values are generally transferred/persisted through effect/event variables or an object's local variables. And while it is technically possible create a variable outside of a function it is only "global" to that script or scripts that included it I wouldn't recommend doing this.
I can't say how others discover things but for me it is reading the wiki; searching the internet and then trial and error/a lot of testing.