I created a script task in the OnProgress event handler of a complex package in order to report the values of all of the variables at each step. This allowed me to grab the dynamic SQL from the variables used as data sources and run it in my query analyzer to make sure I was getting expected data.
It is a lot easier than stepping through the code in debug mode to grab the locals.
Note that the variables collection will only present those variables included in the ReadOnly or ReadWrite Variables selection of the script task, so it isn't cluttered with things you don't need. In my case I used it in the event handler of of the overall package, but it could have just as easily gone into a container's event handler to narrow things down.
We run our jobs through the Tidal scheduler, and by using the FireInformation method the job output will also contain the information I need, so I can get it even when running in test or QA.