See this Comm Center thread by Lee Buck. Others have asked for this along the way as well. Generate a flat plan based on the observations that were done during the night. GIve the flat plan a name that contains the date, and modify the AutoFlat script to look for that before it looks for Default[xxx]Flat. Thus, these nightly flat plans will be saved "forever" and can be re-executed even through the web UI.
I don't know how to provide for the number of flats, maybe a Scheduler option. That option would need to be visible from ACP running scripts!!