Thinking about this.
If this was taken into a function and only called as needed it would help. Also once all the family objects have the right direction then this function could be reduced from checking all the family1 objects to only checking any that are moving...
If you have 10 family objects then this will run 10*10 times - but if you only need to check 1 of the family then it would only need to run 10 times.