Toggle Mail Classic View in Mountain Lion with
The script didn't focus the Viewing tab. Try this instead:

activate application "Mail"
tell application "System Events" to tell process "Mail"
    keystroke "," using command down
    tell window 1
        click button "Viewing" of tool bar 1
        click checkbox "Use classic layout" of group 1 of group 1
        click button 1
    end tell
end tell


If it still doesn't work, it might be because of a bug where the shortcuts for Automator services don't always work until you hover the services menu from the menu bar. See this question for other ways to assign shortcuts to scripts.