I can see a couple of things that you will need to do to get it working. The first thing you need to do is set a value for the remember checkbox. You will need to add in a value="the value" attribute to this form field. Once you do that you should then be triggering the store cookie server behaviors that check to see if this value was posted.
Next you will need to set the default value of the username and password fields to come from the cookies for them.
The final part is the order of the code, you will need to have the cookies that you have on lines 23-35 to be above the code that starts on line 4. With these three updates the remember me option should be working correctly.