The sort step in the script

     Go to Layout ["[search layout]" ([database name])]
     Enter Find Mode [Pause]
     Sort Records [Restore; No dialog]

appeared to be failing. The error is a missing "Perform Find" step. The correct script is

     Go to Layout ["[search layout]" ([database name])]
     Enter Find Mode [Pause]
     Perform Find []
     Sort Records [Restore; No dialog]

Thanks to Steve Cassidy, Richard S. Russell, and Tom Tumbleson for setting me aright.

Onward,
john