OK. An explanation.
The (c:..) function : collects the points and passes them to the (_gp..) function.
(_gp..) function : I didn't write this function, and I don't know who did, as it was in a routine I inherited when I took over my current position. This is a greedy path constructor based on distances between points. This passes the constructed list to the (rh:emLWP ...) function, which makes a closed LWPolyline and the polyline is passed to the (rh:mslen .. ) function.
(rh:mslen ..) function : finds the longest segment of the closed polyline and then shuffles the points so that the longest segment is the last. The closed polyline is then deleted and the list is passed to the (rh:rplk .. ) function before an open lwpolyline is made.
(rh:rplk ..) function : This is a check that the shortest route was found. It was originally written to remove small kinks or minor self intersections from polylines with the aid of the (rh:kurz4..) function and the (rh:sub_lst ..) function. This basically steps through the polyline vertices in groups of 4 points i.e. (1 2 3 4) etc with each being sent to (rh:kurz4 ..). If the return from (rh:kurz4 ..) is different from what was sent the return is substituted for the sent in the point list. The first point (car) is saved to a second list and the processed is repeated on the rest of the list (cdr). This is repeated until there are only 3 points remaining in the original list which are then added to the front of the second list in turn.
(rh:kurz4 ..) function : This assumes that the first and last passed points are fixed and tests if (1 2 3 4) is shorter than (1 3 2 4) returning the shortest.
Clear as mud.