I don't know of any books on debugging, but the way I do it is look closely at the error, esp the line it occurs on and the descriptin then go over a bunch of lines of code (before and after the one it displays).
For instance, if it says Object already exists, then I got the line where the error occurs and look at the object number I'm trying to make there, then go over the rest of my code looking for a bit of code that makes a different object with the same number.
Your error for example comes up with "Runtime Error at Line 2. Ran into Function declaration.", well then you go to line 2 and you see that you've declared a function. You look up and find that there's no piece of code that prevents your program from running into that declaration so you need to add a loop or something that stops that from happening. Maybe:
Do
print
Loop
function getdate()
date$ = left$(get date$(), 6)
date$ = date$ + "20" + right$(get date$(), 2)
endfunction
Debugging comes from a lot of practise, after a while you'll realise exactly why something goes wrong and usually it's because of a silly mistake you made.
"Computers are useless they can only give you answers."