You could trigger the size update by a Filter Change Handler.
The gb << Size message just has an effect, if you fist disable Fit to Window:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Size( 400, 400 ),
Show Control Panel( 0 ),
Set α Level( 0.01 ),
Fit to Window( "Off" ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables( X( :height ), Y( :weight ), Group Y( :age ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
df = gb << Local Data Filter(
Add Filter( columns( :age ), Where( :age == {14, 15} ), Display( :age, N Items( 6 ) ) )
);
adjustSize = Function( {x},
sizeY = N Items( Current Report()["Local Data Filter", ListBoxBox( 1 )] << get selected() ) * 200;
gb << size( 400, sizeY );
);
fsh = df << Make Filter Change Handler( adjustSize );