During the rainy season, a place like the Cayos Holandes in the San Blas is the best place to stay. It's the furthest offshore
and so gets the least rain and lightning.
The thunderstorms come with the tropics during the summer: no way around it, so better not worry too much and enjoy life.
It's perfectly okay to sail from Bocas del Toro to the San Blas and even on to Colombia
during the summer. However, I would not go to Providencia or San Andres from July to December. The later in hurricane
season, the trickier that area gets.
If you like expedition style traveling, while in Bocas, rent a car and drive to Boquette. The mountains provide a nice break to the summer heat and it's a nice drive. I checked the road last year and it looked very good (toll road).