I guess I could have explained that better. The intent is for the shift-click command to select units in descending order of proximity to the unit you have selected. It does not repeat selections, it cycles through the entire list of however many soldiers you have before returning to the original selection. It's just like clicking the next soldier button only the order of the soldiers is determined by distance to the original soldier instead of being fixed to the order of deployment. So instead of the next soldier button always going 123456789 it could be 174928365 instead because 7 is the closest soldier to 1, and 4 is the closest to 7 and so on. Does that make sense? If you want to change the order of proximity you just have to manually select a new soldier.
Using this feature with the Don't Reselect button would be even simpler because in that case it just jumps you to the nearest soldier and would never repeat a selection because all previous soldiers are flagged as inactive.
EDIT: Actually on second thought I'm overcomplicating this, there is no need to make this feature compatible with the next soldier button, the Don't Reselect button would suffice for every use case I can imagine. I will edit the OP to reflect this.