I guess there are differing approaches here. I’m working on a PHP module for Drupal at the moment, and my main file is ~2500 lines long. As I’m using Emacs, I split it up into sections delimited with a special comment beginning ‘///’ (instead of the normal ‘//’ it takes to begin a line comment in PHP), set outline-regexp to ^/// and use outline-minor-mode. This becomes an extremely light-weight form of folding (those section-delimiting comments would probably be there anyway) and makes the length manageable.
I guess your solution here would be to put each section, or a few closely linked sections, into a new file. This is feasible but I find it quicker to use folding compared to switching between different files.