Pong game: how to make the AI paddle move up and down (Javascript)

i am making my first game and know NOTHING about scripting. Ive gotten the paddle to move up but it justs moves off on the Y axis infinitely and leaves the cameras view. i would appreciate any help on how to make the paddle stop at a certain point and come back down on the Y axis… this is what ive got so far…

function Start () {


function Update () {


this is assigned to the cube game object… thanks in advance

Here is something simple that uses arrow keys:

var trans : float = 0.05;

function Update ()
	if (Input.GetKey(KeyCode.LeftArrow))
		transform.Translate(-trans, 0,0);
	if (Input.GetKey(KeyCode.RightArrow))
	if (Input.GetKey(KeyCode.UpArrow))
	if (Input.GetKey(KeyCode.DownArrow))