Just specify the session variable name to save on line 81 like:
$WA_sessionName = "SaveNewID";
Then you can use it when doing the next insert. You don't need to manually add any code in between the inserts.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.