Yes I have used JS in my templates.
I found an example were i put it in the < FooterTemplate> and it works
But I must say I always create asx templates and I don't use the editor.
BTW, the link you posted is 14 years old, what's described there is most likly no going to work.
(looks like classic ASP)