If time is running short, the first thing to do is to put on safety vest before helping other people, even your own children or lover. If the boat is going to sink shortly, jump and swim at least 50m away from it before it starts to sink, as sure it will drag you into the bottom of sea while it is sinking.
After that, there are lots of things to do.
well, the movie of Titantic had done huge research to prove that it won't drag people down to the ocean while it was sinking! So, don't tell anyone that kind of thing will happen unless you really SAW it.
I saw the program named Hollywood Science from discovery channel last week!
In terms of importance and priority, I would think FLOAT, WATER AND FOOD.
These are the essential survival elements. If you are in the open sea, the idea of swimming to shore may not be realistic. Currents could take U away. In HK, usaully, we are quite close to shore and there are many other boats around. Swimming to nearby shore could be an option if you are a good swimmer with floating aids. Try to avoid the windward side where the wave could smash you into the rocks. Of course there are kids and other people in need of help before abandoning the boat.