If you own the skillDev (Skill Development) license, then there is a Skill debugger that you can use to step through your code. Go to the Tools menu in the CIW to find the Skill Development option.
Then click on the Skill Debugger button. Load your code into your CIW after opening the debugger. You can put statements like break() into your code to set break points, or you can use the debugger interface to define what functions to use as break points. All the code stepping will be displayed in the CIW. I recommend you look at the documentation for how to use the debugger. Most of the buttons on the form have corresponding Skill commands that you can put on bindkeys if you wish (Set F7 to step, for example).
You can use the sstatus command to help you debug problems in your Skill code as well. Two settings I find useful are:
;The following gives you a stack trace up to 10 levels deep if your skill code fails
;The following will print the values of all the variables in the procedures in your stack trace at the time of failure