Serial Communication Between Two arduinos (Asking and Receiving)
it is not really easy to follow your code but here is a "hello world" procedure to do an on demand data send between two arduinos:


upload this code to arduino uno before you make any connection on pins 0 and 1 of the board:

/**
 * Code for server side (arduino uno)
 */


uint8_t data2send = 'A'; //data to send on a received request 
uint8_t incomingByte;

void setup() {
        Serial.begin(9600);   
}

void loop() {
        // send data only when you receive data:
        if (Serial.available() &gt; 0) {

                // read the incoming byte:
                incomingByte = Serial.read();

                if(incomingByte=='Q'){  //if incoming data is the expected request (request code = 'Q' in this example)
                        Serial.write(data2send);        
                }
        }
}

connect:

UNO  | MEGA
------------
pin0 | pin18
pin1 | pin19
GND  | GND

upload to arduino mega this code:

 /**
 *  code for arduino mega.
 *  
 *  proxy between Serial0 and Serial1
 *  
 *  send data to Serial0 to forward it to Serial1.
 *  when data is received from Serial1 it will be forwarded to Serial0.
 */

void setup() {
        // initialize both serial ports:
        Serial.begin(9600);
        Serial1.begin(9600);
}

void loop() {
        // read from port 1, send to port 0:
        if (Serial1.available()) {
                int inByte = Serial1.read();
                Serial.write(inByte);
        }

        // read from port 0, send to port 1:
        if (Serial.available()) {
                int inByte = Serial.read();
                Serial1.write(inByte);
        }
}

open the mega's serial monitor and send some characters. Check that you receive back data only when you send a 'Q' character.