Is there anything similar to the Document class in ActionScript? i.e. somewhere that I can place engine code that manages the game? or can I only run code that is attached to game objects?
You have to have at least a single gameobject with a script on as an entry point - after that, it's up to you.
What we do is we have a scene called "Shell". This shell scene contains a single GameObject with our main MonoBehaviour class attached to it, and nothing else.
From there, we programmatically instantiate and update whatever we need.