I don't know if some version of 1.8 or 1.9 is working in a different way but I have used javascripts all the time in labels and for example
<a title="test" href="http://moodle.org"><img alt="test" onmouseout="src='http://moodle.org/theme/moodleorange/hat.gif';" onmouseover="src='http://moodle.org/theme/moodleorange/community.gif';" src="http://moodle.org/theme/moodleorange/hat.gif" title="test" /></a>
without X at the beginning of onmouseover works in my labels (just tested with the latest 1.9.3) - but you may not use HTMLArea to add or edit those tags. "Enable Trusted Content" is not checked - and I am the administrator of my test sites.
The easiest way I usually use is to click my name from the top right corner to edit my profile - Edit profile - When using editor->Use standard web forms - Update profile ... add a resource / Insert a label - Add the code to textarea of Label text - Save and return to the course. This way you can even edit the code and javascripts.
If you want to use HTMLArea you can also Insert a lable (NEW), click <>, paste the code, Save and return t the course but if you click the second time <> before saving HTMLArea goes to WYSIWYG mode and adds those anonymous functions mentioned in bug tracker (each browser has a different way to handle anonymous functions and they should be deleted from code before saving but HTMLArea can't do this - TinyMCE in moodle 2.0 can). So if you want to use HTMLArea with <> you may not click <> again or try to edit the content with HTMLArea because the default state of HTMLArea is WYSIWYG mode, you may only paste the code once in text mode and save. That's the reason why using standard web forms from profile is easier.
This is a bug of HTMLArea - not a filter bug