The following piece of code is a recipe for lockups
while ($remove($read(D:\program files\folding@home\FAHlog.txt,%fahline),$chr(35)) == $null) {
inc %fahline
}
Once %fahline grows bigger than %fahnumlines, $read() will return $null (as the line with index %fahline does not exist), thus $remove() will return $null too, and since you're just /inc-ing %fahline in that loop, it will go on forever.
Apart from that, I can see what seem to be logic errors, for example
if (%udaline > %udanumlines) {
set %udaline 0
}
if (%udaline < %udanumlines) {
If %udaline is greater than %udanumlines, it is set to 0. Since 0 is less than %udanumlines, the second if condition will always succeed. I believe that's not what you intended (if you did intend that, the second if statement is redundant since it will always be true so you may as well remove it) and that you meant "else if" instead of "if" in the second statement.