Write one character then stop

Look carefully at how your code is structured. A great exercise is to go through the code step by step with a pencil and paper pretending your brain is the Arduino.

I think you will find your IF statements are not properly nested. Everything seems to be inside the first IF.

For the future, post your code as a .ino file rather than a .txt file.
Also there are a lot of blank lines in your code which makes it difficult to follow.

...R