Simple Java Script for Opening and Closing a Drawer

I’m pretty new to Java scripting myself and I’ve been searching up quite a few references already to help me build a script that can open and close a drawer (ex. a desk drawer) and show the animation smoothly without recording/playing any animation clips what so ever. I’m pretty lost right now on what to do but my script so far allows me to move the object toward the camera and moves it back to the position it started from.

var wasClicked : boolean;
var start : Transform;
var end : Transform;
var smooth = 5.0;

private var startPoint : Vector3;
private var startTime : float;

function Start() {
startPoint = transform.position;
startTime = Time.time;

function OnMouseOver() {
if(Input.GetMouseButtonDown(0) && wasClicked == false){
wasClicked = true;
else if (Input.GetMouseButtonDown(0) && wasClicked == true){
wasClicked = false;

function Activate() {
transform.position = Vector3.Lerp(start.position, end.position, Time.deltaTime * smooth);

function Deactivate() {
transform.position = Vector3.Lerp(start.position, end.position, Time.time);

Not completely sure what you want.
You could try looking around, like at the follwing?

Hope that helps, you could attach that to the drawer.

~ Myhijim