I remember we had implemented functions for postponing like this somewhere. I am looking into the linked app code again to find it.
Where do I start looking? The most promising place seems the memory type because delays like these use a memory. Now I remember we discussed the delay topic and how to implement a delay.
Here it is:
As I understand your case, it is no problem if the delay is one second longer. So the approach of waiting is enough, no need to adjust the delay within a step.
Here is the definition of the memory type where you can add the field for your delay: bots/implement/applications/eve-online/eve-online-combat-anomaly-bot/BotEngineApp.elm at e9cf4964fbed5d314c76386f1eef75474c5f59dd · Viir/bots · GitHub
You could add a counter like this: stepsSinceLastSawRat: Int
The update depends on if you currently see a rat: If you see a rat, set it to 0. Else, increment it. With this counter, it is also trivial to increase the delay to more than one step.
You can look up the reason using the time travel user interface. Going back in time, you can see how it decided each action. The time travel UI shows a timeline for the selected session, based on the recording the engine had saved to your computer when it was running the session.
Here is the guide on time-travel: bots/guide/observing-and-inspecting-a-bot.md at main · Viir/bots · GitHub