If you open the script file in a worksheet and run it using F5 (Run Script), the SQL statement appears in the output.
If you run the script file using @script the sql statement doesn't appear in the output.
This corresponds to sqlplus behaviour I think, where certain set options only apply to script files, not the current buffer.
Tested using SQL Developer 3.2.09. Older versions may behave differently.