That script would wait 3 to 6 ticks, not seconds. Also, the script would just restart the looping sound at each interval, not playing the sound once and then waiting until the next interval. And 'sound_looping_start' has 2 arguments after the sound reference.
(script continuous lightning
(sleep (random_range (* 30 [low]) (* 30 [high])))
(sound_impulse_start ".sound path" none 1)
)
Change [low] to the minimum number of seconds between thunder sounds, and change [high] to the max number. It will pick any integers between the two.
You could probably make the minimum interval a little less than the length of your sound tag. This way, you'll occasionally hear thunder overlapping twice for more variety.
Also, you have to refer directly to the .sound tag for the thunder in this script instead of the .sound_looping where it says '.sound path'. This is so that it doesn't start looping the sound after it plays.