Hi Swagat,
This problem of yours is very common in the market I beleive. Infact I have been a victim of it few months back. I shortsold GESCOCORP when it was nearing to its upper circuit in the closing hours of day trading (3.00PM). Within minutes I was caught as it touched the upper circuit. (Later I learnt that it is Market makers who play this kind of game. I mean they catch many shortsellers at its uppercircuit, and as the day trading time gets over, the scrip again opens for trading.)
I could not buy as there were no sellers before the time period. At that point of time as I had few shares of it as long, they taken qway from my account and as well as the remaing no. of shares amount. Hence my money also got blocked for about a week as the auction from NSE takes some time. Finally I got the remaing amount with a huge penalty. Hence be cautios while trading opposite at its limit. Of course it is not illeagal, only u pay hefty penalty!!!