Here is a sample script that works using only the top 5 selections, since the sample data table is so small. But I think you can see how it works.
Names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");
dtsumm = dt << Summary(
Group( :height ),
Freq( "None" ),
Weight( "None" )
);
dtsumm << Sort( By( :N Rows ), Order( Descending ), Replace Table(1) );
dtsumm << select where(row()>5)
dtsumm << delete rows;
dtfinal = dt << Join(with(dtsumm) ,
By Matching Columns( :height = :height ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 )
);
Jim