You essentially need to spawn a process, read the session’s port numbers and then send messages via OSC over the local network loopback.
This could easily done from your favourite editor of choice (e.g. Emacs).
Does this mean I just don't understand how to use the existing UI? I'm often messing around with a bunch of chords and sounds and I quickly run out of scratch space. Does that mean I'm doing it wrong?
Do you mean your code was too long that Sonic Pi refused to run it? If so this has been addressed in v5 with much larger buffer sizes supported.
Or do you mean you ran out of buffer? In which case v5 helps again as you can now save and load all the buffers to and from a single save-file :-)
You can also save off all the buffers together (e.g. if you've put different parts of the same song into different buffers) by going to the Live menu and choosing "Save Set As" (or just "Save Set" if you want to overwrite what was previously in your last saved set e.g. you made changes to your song and you want to replace the previous version).
So to achieve a workflow similar to what you're describing, you construct your song (in up to ten buffers) and then save the set and clear the buffers or load a different set to work on another song. True, it doesn't give you infinite buffers, but it does give you a way to "manage all [your] songs as files".
You can then use e.g. Magit to version control the files just as you would if you were working in Emacs itself.
The sets are also saved as text files in a very human readable format; basically just all of the buffers dumped out one after another with some delimiters. You could even use Emacs to edit them and then load them into Sonic Pi to run them! (That said, I'm not sure there's a good sonic-pi-mode for things like indentation and autocomplete yet. Hopefully someday; I would love to have my custom evil-mode Emacs keybindings while working in Sonic Pi, but I get that it's not really a priority right now ;) )
Consider his his older project instead? https://overtone.github.io/
He even used to perform using emacs before he created Sonic Pi.