Rotation limit...

I know how to make an object constantly rotate at a certain rate, but how can I set a degree I want to rotate the object to and make it take a set amount of seconds to get there?

If you only want to rotate around one axis, the best way is to use Mathf.MoveTowardsAngle().

var target = 270.0;
var speed = 45.0;

function Update () {
    var angle : float = Mathf.MoveTowardsAngle
        (transform.eulerAngles.y, target, speed * Time.deltaTime);
    transform.eulerAngles = Vector3 (0, angle, 0);
}

You can check if the target angle has been reached by looking at the delta angle:

if (Mathf.Abs (Mathf.DeltaAngle (angle, target) < 1) {
    // Set new random target
    target = angle + Random.Range (-180, 180);
}

http://unity3d.com/support/documentation/ScriptReference/Quaternion.Slerp.html