Debugging script code

I think the script in this post shows nice examples: