Expanding Magi's code:
<!-- Do stuff untill you find the boss or whatever -->
<While condition="not ActorExistsAt(boss_id, ZetaDia.Me.Position.X, ZetaDia.Me.Position.Y, ZetaDia.Me.Position.Z, 150)">
<!-- Do stuff -->
</While>
<!-- If we are here, boss_id is under 150 range of out bot -->...