Maybe you must enable the logging: https://learn.microsoft.com/en-us/sql/integration-services/lesson-3-add-logging-with-ssis. For example, select the "Windows Event log", and also ScriptTaskLogEntry event, and use the Events system tool instead of Output window.
To write the logs, use Dts.Log or Dts.Events.FireInformation: https://learn.microsoft.com/en-us/sql/integration-services/extending-packages-scripting/task/logging-in-the-script-task.