The way to do it is like adding together force-vectors, each with a direction and a size, to get a resultant "force" or movement. 1. Choose which direction you would like to go. Represent this as a vector. 2. For each "thing" that you want to stay perpendicular to, add a force-vector in one of the two possible perpendicular directions. It might be a good idea to choose the one that gives the longest resultant == most harmonious or most fluid result (less opposition of forces). 3. The final resultant is the direction you will now move in.
The trick is now to assign good force-sizes to reflect the importance of being more perpendicular to some objects (nearby objects, perhaps?) than others. See also ShrapnelDodging
Implemented in Neptune
--tobe