do you only want one opening and should it be the exact same size every time?
I mean you say random, but it shouldn't be random, should it..
There are a lot of conditions it should take into account..
have you seen the infinite jumping example?
It creates random platforms, only thing you'll have to do is go down instead of up and decide which conditions your platforms have..