This code relies on the session variable that is set when an item is added to the cart. If it is not working then it is likely because this value has been reset or not set originally.
To check on this you can try printing out the value on the cart display page to ensure that it is set like this:
The value of the continue redirect session variable is: <%= Session("WAEC_ContinueRedirect") %>
I can see what you are talking about but I don't have any good advice on this. I think you may get a better response by posting to a youtube forum of some type, or maybe even posting here on a new thread.