About a month ago Mattias asked a question about finding layouts of a set of nodes connected by lines that don't produce crossings:
That thread lead to some interesting discussion of force-directed-graphs, but not really any answer to the original question. It stuck in my mind though...
The game quickly gets pretty challenging - and is quite reminiscent of the process of trying to rearrange a grasshopper definition to make it more readable.(and maybe it's good training for that!)
Browsing around some of the material linked to on that page lead to a few interesting mathematical papers on the subject:
Though I haven't studied them too deeply yet, some of them seem to contain promising approaches for automating solutions to this problem:

(a figure from the 3rd paper linked to above)
I think Mathias's original question was about using untangled graphs in the actual product of the design, but I guess they could also be really useful to apply to the grasshopper definition itself.
Imagine something like this (maybe combined with a springs/repulsion force-directed approach) that could automatically rearrange your definition to be more readable.