Too much code.
Irrelevant code in any case.
When you "refresh" a page, you send to the browser the exactly the same request you sent it last time.
If it is a "save" request, then it runs the save code again.
One common approach to prevent this is that after a "save" request, you redirect to a "display" page. Then if the user refreshes that page, they only refresh the "display" request, not the save request.
It makes it a bit harder for them to screw things up with reloading pages anyway.
An article on the subject:
http://www.theserverside.com/patterns/thread.tss?thread_id=20936