Trying to write my first (simple) script: Return to main menu

Bear with me here.

I know the best answer will be “study the tutorials, don’t clog up the forums,” and I get that, I appreciate that. Unfortunately I often have a heck of a time sitting through them. Though I try, and am respectful of everyone’s time and bandwidth.
Decided to test my hand at a touch of scripting in js with just a simple script, but I have zero knowledge of it. (Used to do a bit of programming in Atari Basic, and know enough about Ruby to hurt myself) Essentially, I just want to make a script that, when I hit the game over screen, pressing the “enter” button will send the player back to the main menu. Here is the script:

if(Input.GetKeyDown("enter"))
{
Application.LoadLevel(0);

}

Don’t laugh. I know, it’s probably something close, I’m just not there yet. I figure the way I best learn, trial, error, and mistakes are my friend. Thanks for anyone willing to help. God bless.

As was mentioned in the answer @DESTRUKTORR provided, just make sure you put your code in the Update() function and attach it to a GameObject for it to work. There are some interesting things you have to keep in mind when using the input button names rather than KeyCodes. For instance:

function Update()
{
  // Examples using button names

  // Check to see if the "enter"
  // key on the numberpad is down
  if(Input.GetKeyDown("enter"))
  {
    Application.LoadLevel(0);
  }

  // Check to see if the "enter"
  // key on the main keyboard is down
  if(Input.GetKeyDown("return"))
  {
    Application.LoadLevel(0);
  }

}

Using KeyCodes there is a bit more delineation between the numberpad keys and the keyboard:

function Update () 
{
	// Check if the "enter" key 
	//on the numberpad is down
	if(Input.GetKeyDown(KeyCode.KeypadEnter))
	{
		Application.LoadLevel(0);
	}
	
	// Check if the "enter" key
	// on the keyboard is down
    if(Input.GetKeyDown(KeyCode.Return))
    {
        Application.LoadLevel(0);
    }
}

EDIT: You can find all the KeyCodes and Key Names here for future reference: Unity - Input

You need to put it in a function that is called at run-time. Try this:

function Update () 
{
	if(Input.GetKeyDown("enter"))
        {
             Application.LoadLevel(0);
 
        }
}

Then attach the script to an empty game object, and place it in your scene, or attach it to another game object that will be in all your scenes. The choice is up to you how you get it in there, but it will need to be attached to something IN the scene that somehow calls a function with that stuff in it.