I think you want to remove the [0], because Input.touches is an array, and you want to process each 'touch' in it.
var InitialP: Vector2=touch.position; (and the other one)
You've declared a variable in the body of a condition. I'm not 100% sure about JScript, but it might be that the scope of that variable (where it is valid) is only in that one line of code. You might want to declare those outside: