Can it do both at the same time ?
Of course it can, and does.
I read about the mesh network using xbee. From what I understand in a mesh information can reach the destination in various routes and information flows both ways, meaning A --> B, B --> A.
Yes, that is true. But, if the packet you are sending from A is addressed to B, and it gets there by way of C, D, E, F, and G, does that matter? Only B will do anything with the packet, other than forward it.
When B replies, it should reply to A. The message might go directly from B to A, or it might go from B to H, I, J, C, D, Z, and R to A. Again, does it matter? Only A will do anything with the packet, other than forward it.
With series 2 XBees, the Arduino wouldn't even know that its XBee had received and forward dozens of packets that were not addressed to it.
As it is, your XBee has to pass every message to the Arduino, which is what has to decide whether or not to parse and respond to the message.
You need to have different code on each Arduino. Running a separate sketch to put an ID in EEPROM that the posted sketch reads at run time would enable you to run the posted sketch on each Arduino. The sketch would read the to and from values from EEPROM (which would be different on each Arduino) and decide, then, whether the message was from the correct sender. If it was, it could reply with the correct recipient ID in the packet.
Of course, all that you are trying to do is made much simpler by using Andrew Rapp's XBee library. That library would allow you to address packets to any specific destination, and to easily ignore any packets not intended for itself.