thanks to NickSlash and Rroff telling me what i'd done wrong i now have a turtle program that can recover from being turned off and from server restarts:
http://pastebin.com/MsGzG9mM
you will need to write a file called "quarryData" (without quotes) in the same directory as the quarry program is saved to for the first time you use it, so i figured a little guide might be helpful for those less fluent in computercraft than me. don't forget that everything is case sensitive:
1. place your chunk loading mining turtle anywhere in the world
2. label it by typing in the command "label set name" (without quotes, and replace name with what you want to call it) so that you can pick it up without losing the code on it
3. type in the command "pastebin get 11QZE8sH Quarry" (without quotes)
4. create a file called "quarryData" (without quotes) by typing in the command "edit quarryData" (without quotes)
5. in this file make 10 lines with just the number 0 and nothing else.
6. save the file and then exit it.
you will now need to write a startup file to run your quarry program.
1. as with quarryData, you need to type the command "edit startup" (without quotes) in the console window
2. write the line: shell.run("Quarry")
3. replacing Quarry with whatever you called your Quarry program. save that and it will recover from where it left off rather than waiting for you to restart the program each time
from that point you wont have to worry about the quarryData file any can just plonk it down and set it off mining.
if it tries to recover when you dont want it to then either rewrite the entire quarryData file with 0's again or change the first number in the file to a 0, since that is the one used to trigger the recovery program.
if you find any bugs please let me know
*edit*
just fixed a minor bug. It will now take the enderchest with it if it has to restart mid-unload. new link above
*2nd edit*
i've just remembered that for it to automatically recover you will either need to name the Quarry program startup, or create a startup program that runs the quarry. i've now added this to the instructions in a separate section