You understand everything.
P. S. I don’t need to set script enabled on click, I need to know how to realize it ONLY with script and where I should to attach it. There are no any code examples in docs.
P. P. S. UnityScript (JavaScript) only, please.