I would say that Mysore pak is a candy, not a cake.
There is no stage in the preparation of Mysore pak that requires a refrigerator. You may prefer to store it in the refrigerator once made.
Your description of the method doesn't sound right. Although water will be used in making Mysore pak, it is only used to dissolve the sugar so that it does not burn when heated. The sugar syrup will be heated to single thread consistency (230-235 degrees Celsius) so all the water will have boiled off by that stage. When the sugar reaches single thread consistency, then you add the besan that you have previously roasted in oil, whisk the mixture to a smooth consistency, and then you add the very hot ghee or oil little by little, stirring all the time. If the sugar is not hot enough at the stage when you add the besan, the Mysore pak will not set properly.
After you finish adding the oil and combining well, you let the mixture start bubbling and then immediately pour it out onto a prepared greased plate or greaseproof paper. Of course, it will be very hot. It will have a thick consistency and it will quickly start to become hard. It is easiest to cut it into pieces while it is still warm, after 5-10 minutes. When it reaches the ambient temperature, it will be completely set and have a crunchy, chewy, crumbly fudge consistency. The cooling stage is complete.
Of course, one should not put hot food directly into the refrigerator, so following the correct procedure for making Mysore pak, which involves cooling from a very high temperature to ambient temperature, would not require a refrigerator.
After cooling and cutting, You can transfer your finished candy to a smaller container that you can conveniently put in your small fridge, which may prolong its shelf life. But Mysore pak is not sold as a chilled item and as far as I know people often keep it at ambient temperature in an airtight container.