Ideally, your code will be based around a while-true loop rather than simply a list of commands. If that is the case, then to idling is as simple as executing no code in the body of your while loop.
A simple example in Python:
# Untested Code
while True:
if hero.time < 50: # For the first 50 seconds, only spawn collectors
hero.spawnCollector()
if hero.time > 90: # After 1:30, attempt to cast fire balls
if hero.canCast("fire-ball"):
hero.cast("fire-ball")
# Note:
# If the time is between 50 seconds and 90 seconds, we do nothing (idle)
# If >90 seconds and we cannot afford a fire ball, we will also idle
CodeCombat ensures that a while-true loop will not cause an infinite loop by adding a one tick delay between each iteration (see here).