The answer appears to be that there is no evidence that brainstorm is a pun on rainstorm. As mentioned in the comments, it was originally used to denote 'a violent transient fit of insanity', and according to Webster, that remains its primary definition.
Elaborating on the transition to its present meaning, Ken Greenwald (Fort Collins, CO - U.S.A.) quotes from the book, America in So Many Words:
BRAINSTORM: Originally a brainstorm was a momentary malfunction of the
mind, a ‘cerebral disturbance,’ in the words of an 1894 investigator.
A bright idea was not yet ‘a brainstorm’ but a ‘brain wave,’ as far
back as “Harper’s” magazine of 1890: ‘Lucilla, with what she was fond
of terming a brain wave, comprehended the situation.’ But by the 1920s
‘brain wave’ was subsiding, while ‘brainstorm’ took over the meaning
of ‘a sudden surge of ingenuity.’
The first instance of this transferred sense, ‘He had a brainstorm,’
is recorded in the magazine ‘College Humor’ in early 1925. Many
brainstorms took place after that, such as this one from 1941: ‘Then I
had the brainstorm of getting an English star like Howard to play the
part,’ and another from 1993: ‘Then one of the guys working here had
a brainstorm.’
As the OP has noted, Etymonline fails to provide any additional insight:
"brilliant idea, mental excitement, fit of mental application," 1849, from brain (n.) + figurative use of storm (n.). As a verb, recorded from 1920s.
It is, however, interesting to note a curious discrepancy in the OED in its native and American English definitions for brainstorming. The former defines it as:
- British informal a moment in which one is suddenly unable to think
clearly or act sensibly: we can only assume that someone simply had a
brainstorm and left the important bits out
a spontaneous group discussion to produce ideas and ways of solving problems: the participants held a brainstorm
[as modifier]: brainstorm exercises
North American informal a sudden clever idea: these three brainstorms
may flop like other well-intentioned innovations
IOW, the primary and secondary definitions are more or less contradictory. The AE definition also lists both definitions, but in reverse order. Webster similarly lists these contradictory views:
2a : a sudden bright idea
2b : a harebrained idea
(with 1, of course, being about transient fits of insanity.)