You could also use the below code. It will create column references which look as if the column was added in Formula Editor.
One of the benefits: when the input column is renamed, the formula still works.
dt = Current Data Table();
colNames = dt << get column names( continuous, string );
// Loop through all columns
For each( {col}, colNames,
Eval(
Eval Expr(
New Column(
col || "_Gouge",
Numeric,
"Continuous",
Format( "Best", 10 ),
Formula( (Mean( Expr(Name Expr(As Column( col ) )) [Index(1, 100)]) + Mean(Expr(Name Expr(As Column( col ) )) [Index(N Rows() - 99, N Rows())])) / 2 - Col Minimum(Expr(Name Expr(As Column( col )) )) )
);
)
);
);