Yes, that's it. I drew the track manually in tracklogs and added waypoints for each turn. You can see the gpx file used at the event pages for the two events (26th Sept, Cambridge 100 and Cambridge 200). The routesheets are there also.
You could generate the track automatically as well, but I draw a track when I make a gpx anyway, as I need something to check distances against.
So the script just works through the waypoints in turn, and finds the closest place on the track (interpolating between track points as needed) to generate a distance for each waypoint. The distance calculation is based on WGS84, which is way more accurate than is really needed: there is more error from hidden terrain distance (which I don't currently allow for, though given a track with altitude, I could do that) and from sampling issues: the fewer track points, the shorter the track is. Going from 600-odd points to 450 or so reduces the overall distance by 0.4km on a 100k route.
The automatic nature means the layout is now something that I don't have to bother with, too. It generates an html table for each section, and that has page-break-before:always set, so each section is on its own page (or half-page: I use 2-up printing to print the routesheets). I originally tried outputting csv and importing that into a spreadsheet but it's too cumbersome and handling multi-line complex information e.g. "Info control by grass triangle; answer question on Brevet card" has to be over multiple lines; doing this in a spreadsheet is painful, whereas in an html table cell the row gets taller to accommodate it.
I've also just added a mechanism to support alternate route sections (e.g. to avoid a nasty or difficult section). This currently is a little bit crude; the alternate is in a separate gpx file (probably will always be the case) and is tacked to the route by a special waypoint which tells the distance at which it should start (so that the distances in the alternate match up correctly). This is of course redundant since the waypoint could be found on the original track as with the others, but currently the way the code is structured, only one track can be managed at a time so that needs some rework.
The idea of routesheet to gpx is harder, I think. It requires a bit of AI due to the variable nature of instructions. I think one could come up with something that did a bit of look-ahead to work out if following a particular course matched later turns or not (I end up having to do this sometimes myself when converting routesheets to gpx). But it seems tricky, and routesheets often have errors which the program going to struggle to resolve.