Oracle has some functions like PUT_LINE that you can use to write to a file on the server.
http://www.psoug.org/reference/dbms_output.html If you want to write things to a file on the client, you need some sort of application logic. For example, you can capture the output stream, extract the message with tools like SED, AWK, Perl or whatever you prefer, and then do with the message whatever you like, e.g. writing it to another file. Since I don't know the exact output produced by your script (I don't use Oracle often), others could help you there.
p.s: Personally, I don't think it is a good idea to write something to a file residing on the database server. Most systems beyond the scale of toy systems use a multi-tiered architecture and your application doesn't run on the DBMS server.