See this Comm Center thread by Jim McMillan. Requoting here:
If there is a #duskflat command in a Plan, but it's too late for the AutoFlat script to run, and there is an #AutoFocus directive at the beginning of the Plan, the initial #AutoFocus does not run. It's repeatable. When the #duskflat command is commented out, the #AutoFocus runs as expected.