What is a subroutine?

where do you put a subroutine in a script?
i want to save files with a datetime_stamp sub route, but i cant figure out how to use it.

on get_datetime_stamp() 
   -- Date/Time routine based considerably on one written by Kevin Talbert. Thanks, Kev. 
   set todaysDate to (current date) 
   set timeString to time string of todaysDate 
   set AppleScript's text item delimiters to ":" 
   set a to every text item in timeString 
   set condTime to ((item 1 of a) & (item 2 of a) & (text 1 through -4 of (item 3 of a))) 
   set {m, d, y} to {month, day, year} of todaysDate 
   set monthList to {January, February, March, April, May, June, ¬ 
      July, August, September, October, November, December} 
   repeat with i from 1 to 12 
      if m = (item i of monthList) then 
         set monthString to text -2 thru -1 of ("0" & i) 
         exit repeat 
      end if 
   end repeat 
   set dayString to text -2 thru -1 of ("0" & d) 
   set yearString to text -2 thru -1 of (y as string) 
   set datetime_stamp to monthString & "/" & dayString & "/" & yearString & "-" & condTime 
   return datetime_stamp 
end get_datetime_stamp

You can write handlers (subroutines) anywhere you like in your script, and you cll them by name. For example:

on subroutine1()
  --- do something here
  return true
end subroutine1

on subroutine2()
  -- do something else
  return false
end subroutine2

on get_datetime_stamp()
   -- your code here
   return datetime_stamp
end get_datetime_stamp

set someVar to subroutine1() -- 'someVar' gets the result of subroutine1
set someOtherVar to subroutine2() -- likewise
set currentTimeStamp to get_datetime_stamp()


So I have the sub route working…
I am trying to save a text edit file with the date time stamp…only this doesnt seem to be working…

here is what im trying to do…if someone knows what i should be doing, let me know…

save datetime_stamp  in "OS X:Users:Tim:Desktop:Moblog"