Wow, very lucky. I guess the chances of a plane coming back to the gate AND there being free seats AND you being allowed to board a "closed" flight are fairly tiny.
I had a similar situation in IST a few years ago. Waited in the lounge until it said "go to gate". By the time I got to the gate, the plane had gone. Rebooking was a nightmare, and sadly the plane never came back to pick me up

Ended up staying the night in IST, then flying out to Batumi the next day having paid to reissue the ticket. I was initally told that the ticket was now cancelled...thankfully it wasn't.