Hi Jackie,
Just some additional comments:
Phuket and Phi Phi - these areas are located within the Andaman Sea, which will experience monsoon and rainy season from the months of June-October. Sea conditions can be rough at certain sites and although you can take the daily trips out, it wont be much fun if it rains. And as Mattie had mentioned, getting over to Phi Phi is a real piece of work - there are only 2 ferries a day, and during the off-peak season, only one. once you miss the connection you would have to wait it out till the next day.
If you are going to Thailand in Aug, it will be a better bet to dive Koh Tao, Koh Samui and Koh Pha-ngan located in the Gulf of Thailand - this is the best time to dive the Gulf of Thailand.
Langkawi - would suggest you drop this place if it means more days elsewhere! expensive, touristy place, and the diving is nothing to shout about really. beach is no big deal too, you can find better beaches elsewhere at a much better price.
Sipadan - the prob is getting there, takes quite a bit of travelling. This is really a top site, and you will not do justice to the place just doing a few days of diving here. It is best to spend at least 5 days of diving here. Would even suggest you drop the rest of your itinerary and just spend all your diving days here
Perhentian/Redang are great sites as well. However, it takes time to get to the islands as well, what with the domestic flight connection and catching the ferries to the islands. Tioman is easier to get to, but i dont think it's worth flying all the way down.
I would second SaltyWhale's advice - base your 4 days in Kota Kinabalu, which has lots of land-based attractions worth checking out, then nip on down to Sipadan for some diving. hmmmm come to think about it, i doubt 4 days are enough
i think you will have to prioritise - which is more important - the diving or the land-based travelling? If land-based is important, Thailand might be easier, coz you can do some day trips, and still squeeze in other land-activities easily.