You actually do not need to write all the script. You can make Cadence enerate the script then modify it to include your own loops to sweep on the corners.
To generate the ocean script from cadence. In the Analog Design environment choose:
Session -> save script
Then go to the file, and place your model file inside the loop, changing the corner you need at each iteration.
To run the file, you have two options:
1. In icfb, type: load("file name")
2. open a terminal, type: ocean. run the same comman there.
Hope this helps