Dividing the script up is good advice. Also, if you are not using Python or C# then you should consider it (if this is an option) since every node on the graph tesselates and that hammers performance. One of the drawbacks of visual programming is redundancy, so on large graphs this can become crippling. For example, you may find that 10s (maybe even 100s) of nodes can be condensed into a single python script. You also have the option to dispose objects while the script executes, and this may be the silver bullet you are looking for.
The other major drawback with Dynamo is it has no lightweight geometry library, which means every feature is top-level (or to put it another way, all features inherit the full set of attributes, which adds to the profligacy of the file and impacts on memory).
There's a very useful page on the Dynamo wiki about working with large datasets. It explains the tessellation issue in an easy-to-understand fashion too: