Please edit and wrap your code with [
Also, comments would go leaps and bounds to understand what you are trying to accomplish. Most of the code is, quite frankly, nonsense. I've tried to understand and make notes below.
I strongly suspect you don't understand about available() and read() work... Generally you use a if-statement or while-loop with available() to determine when you've received bytes. Then you read those bytes (and no more than has been received) with read(). I'm not sure I follow what you are doing.
What's the point of storing this value? available() returns the number of bytes available, not any data received.
while (val !=Command || Command);
I think you have two syntax errors in this section. Maybe the following code is what you meant. However, I don't understand why you are using the variable "val" here, since it only contains a number, not "commands".
// val contains the number of bytes available, what's the point of these checks?
while ( (val !=Command) || (val != Command)) // note the missing semicolon...
delay(1000); // otherwise, you'll never see the LED turn off
What? You read in a byte, without checking to see if one is avaiable. Then you keep reading bytes and throwing them away until there are none in the buffer?!