ObjectA has los to ObjectB
ObjectB pick closest to ObjectA
->ObjectA set direction to angle(ObjectA.x,ObjectA,y,ObjectB.x,ObjectB.y)-180
If you don't want it to appear like it's pushing itself away you could use an invisible dummy object, and then move to the dummy position when it doesn't have los.
Not that it would guarantee a non los position for every circumstance. It could, in theory, just go forever.
But it is fun to watch.