When you get that error, use a text editor to open HalScript.dgb in your UltraHal directory and copy several lines in the area around line #1816 (or what ever it says when you get that error again) and post that.
I once got a similar error when I made a math addin function with some cross naming...