Wouldn't min() show the closest and max() show the furthest?
So it looks like in your example that I would just substitute Step 4 for a different calculation that looks something like this:
min(distance(${previous1stpoint},${firstPointFromNewGeotrace}))
If you have a variable in the repeat_count column, don't repeat instances get created the moment that variable calculates? I would think if you only had calculate fields in the repeat and didn't make the repeat or any of its fields irrelevant that it would instantly make all the repeats and calculations (if the variables in those calculations already have values) in those repeats the moment the repeat_count variable is calculated...