Debugging complex scripts

Does anyone else have problems debugging complex scripts. I have one with a couple of thousand lines of code now and several thousand variables I should think (depending on what the program’s up to). When I set the debugger going it just locks solid, which reduces me to using trace to debug with. Hardly an elegant solution. Is there an external program that can be used to debug actionscript or is there some way of improving the way the debugger works?