Help needed: Want to the user to input his name and then show that text on other scene

I'm not sure exactly how to fix your problem, but here are some general comments...

// Load Sound Volume
if (localStorage.sv >= 0) {
var sv = localStorage.sv;
} else {
var sv = 8;
}

That's an example from Annoyed Tomatoes. It's loading the previous sound volume. It checks to see if the user previously set the volume. If the localStorage variable "sv" (which is short for "sound volume") is greater than or equal to zero, then the user saved the value. If not, then set it to the default value of "8".

That general idea should be what you need to solve the problem. If there is a player name entered already, then don't bother asking for it. Otherwise, the player enters their name. The tricky part is checking to see if the name variable is empty. I'm not quite sure about this part, but here's a guess...

// Load Player Name
if (localStorage.name.length > 0) {
 // Welcome back player
} else {
 // Who are you player?
}