Being able to use enemies for one's own advantage is very creative, and I am also curious about how the code works. It's great!
Thanks!Not the most optimzed code in Earth, but it a little bit like that:
if enemy == bad: follow player elif enemy == off: do nothing elif enemy == good: keep same distance, angle, and relative angle in relation to player