I would stick to the ascii key code. It seems to me that they work better most of the time. So the syntax to emulate the press is:
tell application "System Events"
tell process "the process you want to effect"
keystroke (ASCII character 27)
end tell
end tell
Also, you have to make sure that support for assistive devices is enabled. You can do this by going to System Preferences-->Universal Access-->Enable Access for Assistive Devices. Finally, if the command is part of a larger script, you may need to insert some delays after or before the keystroke to allow the application to react. Good Luck!