I wish there was a way to differentiate variables between hardcoded non-variables in those vBulletin code tags. For example, "void" and "run" aren't variables, but I'd bet that "foo" and "thisisglobal" are.
Technically, foo is the name of the script, which is different from a variable. It is user-defined, though, if that's what you mean.

You'd imagine that such variable names would be absolutely common sense that they're user-created variables, but then again, with me seeing so many variables called "this->" (That exact variable, "this" .. yes.) it's getting hard to tell.
this isn't a variable; it's a pointer to the current FFC. Whenever you see this->anything, it's accessing the properties of the FFC that's running the script.

What determines if a variable will be global or not though? How would you set one up to be global vs a single-script variable?
If I'm not mistaken, the way it is now, any variables declared inside run() or outside of any function are automatically global.