Also, it seems as it prints "Command received:" every iteration, regardless of if there's new data or not (although, this could be the intended feature).

Like mentioned, you don't clear the variable, you just create a new one. You'll need to clear and reset count to fix this issue. However, just resetting count won't work if the second command is shorter than the one before.

Also, why do you complicate the code with the dataComplete variable? I simplified the code below:

Your output says you are clearing the data array, but you're doing no such thing. In fact, you are declaring a new local variable called data, which is independent of the global data you already have declared at the top of your program. Local variables only exist within the scope in which they are declared (inside their nearest enclosing { }).

Instead, your count variable keeps track of how much data you have received. So perhaps do the following:

Serial.println("There is data already, clearing...");
count = 0;

This is not the only thing that might cause your program to operate unexpectedly, but it should at least fix the problem stated in your question.

Also a null terminator is needed for data: Add data[count]='\0'; after dataComplete = true;
– CraigJul 3 '14 at 21:47

Yes, that's true, but the larger problem is that there is no way for the sender to indicate the end of a data transmission other than to pause. And since this is serial, there is going to be a long enough pause in between every character transmitted.
– Greg HewgillJul 3 '14 at 21:49

Thanks to both of you guys. My code was wrong and changing it to "count = 0" worked. I also added a delimiter to indicate the end of an input command and it works as intended now. However, the only way that worked to empty the "data" array was using a for loop as indicated by @JRobert: this way newer commands work even if they are shorter than older ones.
– squeckJul 4 '14 at 22:51