Double Tap Directional Key = Run?

I am creating a 2D Sidescrolling game using the basis of the 2D Platformer available from the Unity3D website.

Everything is working fine, I would just like to change a couple of the controls around a bit. Instead of having to hold CTRL (Control) down to run, I would like the user to be able to simply double-tap the right/left arrow keys and have the character run until they are let go.

Would this be possible and, if so, how? Here is what I am looking at:

function UpdateSmoothedMovementDirection () {	
	var h = Input.GetAxisRaw ("Horizontal");
	
	if (!canControl)
		h = 0.0;
	
	movement.isMoving = Mathf.Abs (h) > 0.1;
		
	if (movement.isMoving)
		movement.direction = Vector3 (h, 0, 0);
	
	// Grounded controls
	if (controller.isGrounded) {
		// Smooth the speed based on the current target direction
		var curSmooth = movement.speedSmoothing * Time.deltaTime;
		
		// Choose target speed
		var targetSpeed = Mathf.Min (Mathf.Abs(h), 1.0);
	
		// Pick speed modifier
		if (Input.GetButton("Fire1")  canControl) // INSTEAD OF "FIRE1" (CTRL), I WANT 2 HORIZONTAL TAPS
			targetSpeed *= movement.runSpeed;
		else
			targetSpeed *= movement.walkSpeed;
		
		movement.speed = Mathf.Lerp (movement.speed, targetSpeed, curSmooth);
		
		movement.hangTime = 0.0;
	}
	else {
		// In air controls
		movement.hangTime += Time.deltaTime;
		if (movement.isMoving)
			movement.inAirVelocity += Vector3 (Mathf.Sign(h), 0, 0) * Time.deltaTime * movement.inAirControlAcceleration;
	}
}

Here’s something that I made, to that effect. See if it’s helpful to you:

http://forum.unity3d.com/threads/8620-Double-Tapping-axis-input?p=393218&viewfull=1#post393218

How would I get that to work on my Player? That example seems more geared towards GameObjects unless I am mistaken? And why is the file a .CS file, exactly?

Everything you can select in the Unity Hierarchy or Scene view is a GameObject. Your “Player” is Game Object. .cs is the extension for a C# script.

Yes, I do not know how to get the .CS file into my project?

Sorry, I am quite new to Unity.

Drag it, just like anying else.

?

Downloading is screwing up the file name. Just rename the file to whatever I named the class.