Add null-safe index helpers for `TimerEntity` and handle empty steps in `forEachStep` logic