The error seems to suggest your script task may be trying to display a message box. When this package is running via the agent there is no user to display the message box to. Therefore if you want to display some sort of output or message you'll have to come up with another way of doing it. Maybe write an entry to a log file or something?
Thanks,
Simon