Hi there,
In the future I would check the System Preferences...
Could you have somehow changed the modifier keys in the System Preferences-->Keyboard & Mouse-->Keyboard .... Modifier Keys button
If the Caps lock was changed to the command key...this would give the behaviour that you described..
Alternatively, if you had run an AppleScript that crashed part way through, that had implemented a "Keystroke command down" this can lock the command key down... and will only be corrected by restarting or running a "command key up" AppleScript...
regards
Ric