Animate object on mouse button press

how can I play an animation on a button press, and on release, play another one. eg. while right mouse button is down-play animation and then pause at the end of the animation, then on release of the mouse button, play another animation.

I need this for looking down a sight... if there is an easier way then say, but what I stated above is what i'm looking for. thanks

You can write something like this:

function Update(){
   if (Input.GetMouseButtonDown(0)){
      animation.clip = clip1;
      animation.Play(animation.clip)
   }
   if (Input.GetMouseButtonUp(0)){
      animation.clip = clip2;
      animation.Play(animation.clip)
   }
}