I'm sorry, this is going to be a complete noob question: I adjusted the excellent user script of Nathan to support some long wanted functionality.
When I'm looking at the code, I find things I don't understand. For instance he uses some obviously global variables like StackExchange.MarkdownEditor and I have absolutely no idea how I could have found this myself.
Is there any QA here about What you have to know when you want to write a user-script for an SE site?
(I'm fully aware, that it is quite likely, that my question does not make any sense)
Hm, no, not that I'm aware of. It mostly just comes from a familiarity with the Stack Exchange JavaScript code, which I for my part have as a result of meddling in bug reports on Meta.
That said, I suppose it might not hurt to write up something like that, although obviously the internals of the site are subject to change without warning.
Well, you can explore the various pieces of the StackExchange object using the inspector tools in Chrome, which can give you some insight about what's there. For actually knowing what everything does and how exactly you can use it, there's not a lot of options other than looking at the minified source code and trying to piece together what everything does.
Oh, I lied a little. You can actually view the unminified JavaScript from the dev site.
For example, the source code of full.js, which contains most of the site's functionality.