Sorry I don't have time to read through your script at the moment (will try to later) but as far as proggies go, create a ScriptTerminate procedure (I am pretty sure they run when the script is stopped) and then in it you just use writeln() to write what your script has done for example how long te script ran for, how many chickens killed, how many levels gained (if you have a level gained detection built in). If you don't understand then have a go and post what you did and we can tell you what is wrong with it!
Note: when using writeln if you are writing a variable that is a number (e.g. ChickensKilled) you must go:
SCAR Code:
writeln('bla bla bla' + IntToStr(ChickensKilled) + 'bla bla');
to convert the integer to a string, if you are typing the number yourself then it is fine e.g:
SCAR Code:
writeln('Typing 9 is fine!');
good luck!