I solved this one after poking around and trying all suggestions and all ideas that came into my head as I read about "similar" problems. The solution appears to have two steps, although the second may be more a limitation on the first than an independent step.
As a preliminary matter, it is unnecessary to have anything more than "killall Finder" at the end of the shell script to have the Finder close and relaunch. I got the script working with nothing more than that at the end.
1. The Automator application belongs in the following directory:
~/Library/Scripts/Applications/Finder
I could not get it working until I moved it there, and it started working as soon as I moved it there. When I put the application in that directory, I saw a new entry for "Toggle Hidden Files" (my name) in the scripts pull-down menu in the Menu Bar. But see (2) below.
2. This one is strange and may be my own idiosyncracy because I keep a lot of my Automator stuff in an Applications subfolder and place aliases thereof in other folders. When I tried to drag the original Toggle Hidden Files application to the folder in (1), the Finder would only allow an alias to be placed in that folder. Fine, that's what I normally do anyway. However, any time I edit or even so much as open the application in Automator, the application disappears from the scripts pull-down menu in the Menu Bar and I must again drag the application (and thereby make an alias) to the folder in (1). There must be something special about that folder in Mountain Lion. Other folks may not see the same behavior with alias creation, editing the original application, or merely opening without editing the original application in Automator, but that's how it works on my iMac.
Maddening stuff.
P.S. One little oddity is that I can see Toggle Hidden Files in the scripts pull-down menu only when the focus is on my Desktop or an open Folder (or, presumably, some other aspect of the Finder). I'll just have to remember that. I can strain my brain only so much.