I had just tried a test that got the same problem you did. I hoped/assumed that Quest internally would take the function script from the code view and stick it inside a function like:
<function name="test">
// Code view code would be inserted here.
</function>
So I tried having my code view code be:
</function>
<function name="test2">
in the hopes that it would become this:
<function name="test">
</function>
<function name="test2">
</function>
giving us a place to insert arbitrary code thereafter. But it just crashed the web editor...