It sounds like you are now asking about how to do other things while waiting for serial bytes to come in. You could define a function like
unsigned char is_byte_available()
return UCSR0A & (1 << RXC0);
Then try writing a program to print 'x' until a character other than 'g' is pressed:
while(!is_byte_available() || serial_read() == 'g')
If that works for you, try writing a program that waits for a 'g' (you have that part already) and then runs that loop. Then you should be able to modify it to do whatever you want.
If you get stuck at some point, and you want help, please post the last step that worked and the first step that did not work.