What is the difference between `on` and `to` in AppleScript handler declaration
There's no difference between them. Both on and to are acceptable.

From Using Handlers/Functions


  Listing 13-3 shows a variation of the handler in Listing 13-1, which uses the to prefix instead of on. Either syntax is acceptable.


From Handler Reference

( on | to ) handlerName ¬
   [ [ of | in ] directParamName ] ¬
   [ ASLabel userParamName ]... ¬
   [ given userLabel:userParamName [, userLabel:userParamName ]...]
      [ statement ]...
end [ handlerName ]