#near line 28, add:import time
# near the line 101-102, just after "tar.close()", addprint "----- IT IS TIME NOW !-----" time.sleep(60)
# Note that you can adjust the time (60) by the value in seconds of your choice...
Theses lines should be like : tar.close()
# Wait about 1 minute (time to modify update script)
print "----- IT IS TIME NOW !-----" time.sleep(60)
return True

# Note that you must keep the text idented

Run sudo do-release-upgrade

When the script sleeps, you have just 60 seconds to do the next step:
-- Modified /tmp/tmpXXXXXX/prerequists-sources.list and prerequists-sources.dapper.list and changed them to "old-releases" as well.

Then wait until the script continues running and asks:

"Do you want to
modify the sources list?"

Make sure you don't press enter along the
way or it skips that question by assuming a "no".) It will say:
"WARNING: Failed to read mirror file."

Go fix /etc/apt/sources.list back to the way it used to be
now. With "us.archive" instead of "old-releases" (except for the
security lines, that should just be "security.ubuntu.com".

Return to the update and say Yes.
The updater will modify /etc/apt/sources.list and replace all the dapper entries with hardy entries and continue updating using the servers.