var variableScript : Component; <-- this is your problem. Instead of "Component", specify your actual script. For example if your script is HelloWorld, specify that.
There is no point in doing this after:
variableScript = target.GetComponent(variableScriptName);
That said, you code in javascript. I don't know javascript, so I can't help you further.