I'm able to send AT commands to GSM modem,
but i am not able interface my 8051 to GSM model.
can i get sample inerfacing code for 8051 micro controller.
There are plenty of 8051 derivatives available with two UARTs - why not just use one of them?
http://www.keil.com/dd/search_parm.asp
Get your system working like this first, then think about adding the complication of multiplexing if you still think it's worth it...
Remember that GSM modems can send unsolicited messages - you will miss them if they happen while the multiplexer is switched to the GPS... The converse may also be true of your GPS...