Apart from loops and conditionals Allen's script also breaks variable scope, function definitions (not that you're likely to have too many from 3.x), multi-line strings, long commands with line breaks for readability and other KiXtart intrinsics and constructs.

I'd recommend that you don't use Allen's script (sorry Allen) as if you're newish to KiXtart you'll end up spending a lot of time trying to fix perfectly working scrips that only fail because they are being executed in a strange way.

Occasional debug code is usually sufficient - I often leave it in place and control whether it displays or not with global variable.

You also have the option of running the script with the built-in debug tools if you want to step through the code, either using the "/d" command line switch or "DEBUG ON" in the code.

There are a few things that changed in the jump from 3.x to 4.x but they are well known and easily fixed, search the board for more information and post any script you are having difficulty with.