I've done that before in another map. I'll paste the relevant parts of that trigger here. Most of my variables are named to make sense when I (you) read the code. But if something is unclear, ask away.
Local Variables Birds path = (Distance between Player[x].Current Position and Rally Click) <Real> offset = 0.0 <Real> Actions General - While (Conditions) are true, do (Actions) Conditions offset <= Birds path Actions General - If (Conditions) then do (Actions) else do (Actions) If ((Player[x].Current Position offset by offset towards Rally Click) is passable) == false Then Variable - Set Rally Click = Player[x].Current Position Unit - Order Player[x].Hero to ( Set Next Move targeting Player[x].Current Position) (Replace Existing Orders) Variable - Set offset = Birds path Else Variable - Modify offset: + 0.1
When an obstacle is found I want my unit to stay still, but you'll want to change the new order to target the current position on the offset - 0.1 since that was the last position that was clear.
Afterwards, I set the offset to Birds path so that the while loop ends and doesn't check any more.