It's just his own variable and function names. It's all plain ol' AppleScript, and will work with any language.
It's easy to simulate a command-period in AppleScript. Just do this:
tell application "System Events" to keystroke "." using command down
(You may need to enable GUI Scripting for that to work. You can do this in AppleScript Utility, which is located in /Applications/AppleScript/)
As for how to tell when Excel is taking too long, I'm not sure. As Barhar suggested, it may be easier to have the script identify the troublesome items and simply not attempt to process them.
I can think of no easy way for a script to tell if an action that it did not initiate is taking too long. There might be some way specific to Excel, but since I don't use Excel, I don't know.
If you do initiate the command from within AppleScript, you might find AppleScript's "with timeout" statement useful when used inside a "try" statement. A little example:
Code:
try
with timeout of 5 seconds
tell application "Excel"
--process something
end tell
end timeout
on error
tell application "System Events" to keystroke "." using command down
end try