Edit: See >post #3 for later code created in 2013 for use in AutoIt 3.3.81 and later.
A simple UDF I made based on the idea of returning variable values from a script at the point of runtime closure. I manage to catch the Globals but the Locals would need more impressive code that would need to run within the functions themselves. It maybe useful for some and perhaps fun to others.
It is set to dump the variables to Console so is perfect for editors that support this, such as Scite4AutoIt3