As @JMichaelTX says, AppleScript is presumably simulating the right key strokes, but it is possible your target application is looking at the keyboard modifiers directly, rather than the keystroke events (this would generally be bad behaviour, which you would expect only from a cross platform/Java/etc application of some sort).
The best solution at that point is to start your macro with a Pause Until action, with the Modifiers condition, set to nothing pressed, so your macro waits until you release the Command key and then continues with the simulated keystrokes.