Well, using pattern matching you can do it quite easily. You just define two distance function of different arities (e.g., the number of arguments). You call the first distance function and it calls the second one. This is a form of tail recursion. In each step the first element of the list is removed and the distance to the next point is computed and stored in the second argument (which is called an accumulator) and the function is called again. In the last step only one coordinate remains and then the final distance is computed and returned (with no recursion).
Clear[distance, x1, x2, y1, y2];
distance[pts_List] := distance[pts, 0];
distance[{{x1_, y1_}, {x2_, y2_}, rest___}, tot_] :=
distance[{{x2, y2}, rest}, Abs[x1 - x2] + Abs[y1 - y2]];
distance[{{x_, y_}}, len_] := len + Abs[x] + Abs[y];
Now, notice that your definition of a distance is the ManhattanDistance
that is already defined in Mathematica, so I change the program to use it
Clear[distance, x1, x2, y1, y2];
distance[pts_List] := distance[pts, 0];
distance[{{x1_, y1_}, {x2_, y2_}, rest___}, tot_] :=
distance[{{x2, y2}, rest}, ManhattanDistance[{x1, y1}, {x2, y2}]];
distance[{{x_, y_}}, len_] := len + ManhattanDistance[{x, y}, {0, 0}];
As a last step, if you want to compute also the distance from the origin to the first point (coordinate) then all you need is to change the initial distance as follows
Clear[distance, x1, x2, y1, y2];
distance[pts_List] :=
distance[pts, ManhattanDistance[First[pts], {0, 0}]];
distance[{{x1_, y1_}, {x2_, y2_}, rest___}, tot_] :=
distance[{{x2, y2}, rest}, ManhattanDistance[{x1, y1}, {x2, y2}]];
distance[{{x_, y_}}, len_] := len + ManhattanDistance[{x, y}, {0, 0}];
yehuda