Azndaddy, what you're referring to is basic programming logic, fundamentally in the if/then area of logic. This will be a common task throughout your programming career and in this case, because the code you provided is a little obscure, is a task only you will be able to complete.
Post more general code and we can assist. But basically, it goes something like this:
...
if (command != desired) {
// do something to imply wrong command
} else {
// do the thing you were meaning to do
}
...