Here's the system.
Press ESC to start pathing. Move around with the unit. A periodic trigger checks the position of the unit and saves it to an array. If the position is not far enough from the previous saved position, then the position will not be stored. You don't need to save waypoints that are very close to the previous one. You can define the distance at map initialization.
When you press ESC again, a unit spawns and runs through the waypoints.
When you press ESC again, you can start pathing again. All previous waypoints will be cleared.
The dummies are spawned so you can see where the waypoints are. You can remove all lines concerning dummies from the final code.
I was too lazy to comment the triggers, if you have questions ask them in this thread.