hi aporter,
until someone smarter comes up with a one liner you can try my plumbers solution:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "Row", formula( :Row() ), eval formula );
dt:row << delete formula;
// assuming age is time and sex is site
dt << Sort( By( :sex, :age ), Order( Ascending, Ascending ), replace table );
// now sum as you want it
dt << New Column( "sumhightbysex",
formula( If( Row() == 1, :height, :sex == Lag( :sex, 1 ), :height + Lag( :height, 1 ), :sex != Lag( :sex, 1 ), :height, Empty() ) ), eval formula
);
dt:sumhightbysex << delete formula;
// sort to original order
dt << Sort( By( :Row ), Order( Ascending ), replace table );
// clean up
dt << delete column (row);
Speak( "bob's your uncle" );