You can in fact use a Rich Text area.
The problem isn't actually the CDATA wrapper -- that's outdated, but harmless, and doesn't stop the code from running.
The problem is that because of the way a form is built out in the DOM, your script will be injected and run twice (which can cause really bad bugs).
So you need to take a rather primitive approach to making sure the function in a given RT area runs only once: name the function uniquely (inside the code block) and note the fact that it's already been run to a global object.
<script>
window.MktoForms2BehaviorsRunCache = window.MktoForms2BehaviorsRunCache || {};
(function(){
var thisBehavior = "behavior1"; // choose unique function name
if (thisBehavior in window.MktoForms2BehaviorsRunCache) {
return;
} else {
window.MktoForms2BehaviorsRunCache[thisBehavior] = new Date();
}
// do your stuff here
})();
</script>
Once you wrap the code like this it'll work reliably.
I do greatly prefer to keep behaviors in external files, however, since they can be updated without reapproval or touching the Form Editor at all.