I have had a couple of thunderstorms roll in whilst I have been diving, each time it has happened on night dives in the eastern Mediterranean when the temperature changes at nightfall have caused storms and winds to blow in, not that common and not on the forecast. BUT it really is truly awesome to watch lighting flashes overhead whilst night diving and we have always been able to stay below 30 foot until it has passed.
The storms have always been whilst we have been doing shore dives and we have always exited the water quickly at the end of the dive until we have been certain that the storm really had passed. Once we ditched tanks and bcd's right by the shore and walked up in just wetsuits because the storm still seemed to be close to us, but even that one passed quickly and we collected the tanks without issue.
I certainly would not choose to kit up or walk around with a tank on in a storm, or even want to be bobbing around on the surface, but if you are already in the water and stay at a reasonable depth then you are perfectly safe, if you have enough air then wait it out and enjoy the show, if not then surface as close to the shore as you can, ditch and stash your tanks and bcd and move away from them to a safe location to wait till it is safe to collect them.
I have never experienced a storm on a boat dive, but as I normally only dive from ribs I would want to get ashore as soon as possible. - Phil.