A Perl approach:
perl -00 -M"List::Util qw/shuffle/" -lpe 'if(/^\(/){$_=join "\n",shuffle split(/\n/); }' file
And the same thing as a commented script:
#!/usr/bin/env perl
## Import the shuffle function from the List::Util module.
## This is done by the -M in the one-liner .
use List::Util qw/shuffle/;
## Enable paragraph mode, where each input record is a paragraph.
## This is equivalent to -00 in the one-liner.
$/ = "";
## set output record separator (done by -l when after -00)
$\ = "\n\n";
## Read each record of standard input into the special variable $_.
## -p in the one-liner adds a similar implicit loop around the code
## given to -e.
while (<>) {
## strip trailing newlines (done by -l in the one-liner)
chomp;
## If this record starts with a parenthesis
if(/^\(/){
## Split the record (here, the entire paragraph, the whole section
## until the next sequence of one or more empty lines) on newline
## characters and save in the array @lines. In the one-liner, I skipped
## creating this temporary array and joined the split directly
@lines = split(/\n/);
## Set the special variable $_ to hold the shuffled contents of
## the @lines array, now connected with newline characters again.
$_ = join "\n",shuffle @lines
}
## Print whatever is in the $_ variable. That's the additional thing
## -p does compared to -n.
print
}
And, just for fun, here's a slightly shorter version:
perl -MList::Util=shuffle -00lpe'$_=join"\n",shuffle split/\n/ if/^\(/' file