I think you can just update the waypoint number in the property tree, i.e. "autopilot/route-manager/current-wp".
Obviously you need to check that it's not the last waypoint by looking at "autopilot/route-manager/route/num".
I wrote a script to do similar, but it works on turn radius and change in heading, which produces a much cleaner result than just doing it at 1nm. It also has fairly crude support for flyover waypoints based on turn angle. You can probably take some functions from here or just adapt the whole thing:
waypoint-smoothing.nasIt should probably be updated to use maketimer rather than settimer.