when you are testing, you figure out what is causing the crash by the last line that executed - put print statements after or before each line in the troublesome area and you'll know what executed last. Then you put a stop statement before the line that failed and check the values of the variables. If there was an "Invalid" variable then find out why it was invalid by backtracking through your code. If it is an "Invalid Brightscript" error, then a variable you were expecting to by of one type is probably another type or invalid, figure out why, again by backtracking through the code. 90% of the issues you encounter are going to by typo's the rest will be forgetting a "Then" or a "Next" or a parenthesis.
Of course, this assumes you have a telnet session going with your roku box the whole time, which you should.
- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!