What happens to Margin amount for OTM contract at expiry

I would like to know what will happen to my margin when I short a call/put option and the position is Out of the Money at expiry?

Ex: If I short Nifty 7750 put option for April contract and would have an amount of Margin taken from my balance. At expiry if Nifty is at 7900 leaving my put position out of the money. What will happen to the amount that was set as Margin from my account balance?

Note: When I tried this in NSE paathshala, the margin amount was never returned to my available balance.

Is it required that I still need to square off the out of the money position before expiry?

The margin blocked gets unblocked after close of expiry for all short option positions. I am guessing there is some limitation with it. Suggest you to go through this module on option theory

Thanks NIthin.

My question is best explained by an example.

Let’s say today 1-Apr-2020, I have following short positions expire OTM.
SHORT CE NIFTY 9000 1-Apr-2020 : 1 lot
SHORT CE NIFTY 9500 1-Apr-2020 : 1 lot

During the day I enter into a short position for far dated option,
SHORT CE NIFTY 10000 30-Apr-2020 : 1 lot

After entering the position, I have 1K margin left. But by the close of trading due to IV changes, I have margin shortfall of let’s say 5K when the trading closes for the day.

Do I need to bring additional margin in this case, where I will have margin being unblocked for two positions today evening/night?