Hi Tiago
The screen preparation is code that is run in the server, not the browser. So it actually does not make much sense to _run_ javascript in the preparation - instead it would make sense to _generate_ javascript to be placed somewhere in the page, as to produce some result.
Can you specify what you want to do? Maybe I am not seeing your scenario completely...