Might be a long shot, but with 6000 lines of code, how big is the script in KB? Maybe you are reaching some kind of memory limit in KiXtart with regards to reading the file into memory? I have scripts + UDF libraries up to 170KB which haven't yet caused any problems.
Maybe you could try to create a 6000+ line file filled with just comments and see whether this will cause a problem, too?
Alternatively, if you put the UDFs into a separate UDf file and call it in the beginning of the script, does the same CPU utilization occur?
Just trying to list the things I'd to to troubleshoot that particular problem.
_________________________
There are two types of vessels, submarines and targets.