Hi Kunal,
My experience of that functions also fails intermittently. To workaround the problem use the synch bitmap function. Note: the synch window and synch bitmap functions work better when the citrix application is configured to present in Classic window theme.
If your application is deployed over several Citrix presentation servers make sure the presentation config is the same across all the servers i.e colour depth e.g 16 or 32 bits, Windows classic theme etc. Get your Citrix admin to check these settings. I experienced an intermittent failure on synch window and bitmap function on one of the projects and I traced back to incorrect config on a Citrix server. All these small settings make a big difference in your script.
John