How you replace it depends on the use case, in your case using AsColumn as @pmroz suggested is the easiest option.
Few links
Below are few other options but they do require more scripting which is usually unnecessary in this type of cases
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
hvar = "height";
gvar = "sex";
// As Column
std = Col Std Dev(If(!Excluded(Row State()) & As Column(dt, gvar) == "M", As Column(dt, hvar)));
// Data table subscripting
// https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013
rows_of_interest = dt << Get Rows Where(Excluded(Row State()) == 0 & Column(gvar)[] == "M");
std2 = Std Dev(dt[rows_of_interest, hvar]);
// Build and evaluate expression
// https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/ta-p/48998
std3 = Eval(Substitute(
Expr(Col Std Dev(If(!Excluded(Row State()) & groupcol == "M", numcol))),
Expr(groupcol), Name Expr(AsColumn(gvar)),
Expr(numcol), Name Expr(AsColumn(hvar))
));
// Check
std4 = Col Std Dev(If(Excluded(Row State()) == 0 & :sex == "M", :height));
show(std, std2, std3, std4);
-Jarmo