Transceiver function of USRP

hi…
i are trying to implement a transceiver function in gnu radio.what i
want is that the usrp be in the transmitting mode for say a specified
no. of packets and then it switches onto the receiving mode for another
specified no. of packets. i have already seen usrp_nbfm_ptt.py which
does exactly the same thing but it is event driven. i am not able to
understand how does this switching exactly take place in that and how
does by just making one flow graph we are able to switch. i have tried
making it go automatically by using the start(),stop() and wait()
functions of the flow graph but have not managed to do it. Maybe what i
am trying is the wrong approach,so can anybody please explain how to do
the above thing. i jus want that the event driven thing in
usrp_nbfm_ptt.py switch automatically based on any criteria, be it no.
of packets, time etc.

thanks
pratik hetamsaria