There are errors in your diagrams. As drawn, the relays do nothing, with the exception of what you labeled flow relay pole 2, which will burn out your 24V heater supply by connecting it to 120 (or 240) Vac. That 24V heater supply is also new information not included in my diagram.
Also, no timing diagrams are needed if all you want to do is run the flush cycle when the water flow stops, which is how I understand what you said: "Whenever water stops running into the heater, I'd like to flush fresh (tap) water through the heater for some fixed amount of time (something like 5-10 minutes)."
The only event that matters in terms of initiating the flush cycle is water flow stopping.
You also added a requirement: during the flush cycle, you want the heater to be off.
Ok. To do what you want you need a time delay relay (delay on break), a normally open flow sensor, and a heat relay (dpdt). (I assume you already have the other parts - heater, pump, flush solenoid, etc.)
When water flows, the flow sensor closes and energizes the heat relay and starts the time delay relay. When flow stops, the flow sensor opens and the heat relay de-energizes. The time delay relay stays energized via its internal circuitry for X more minutes (where X is the time you want), then de-energizes.
Flow Sensor TD no o----+ / HR-1 nc / | Vac ---+---o o----+---o->o------o | | | | TD relay
********************************** There is an error in the diagram below. Vac is always connected to this point v below v
Another error - 24V supply can connect to Vac above