You cannot use Col sum in "plain" JSL code to assign the result to a variable.
It'a a cool aggregation function which can be used in Column Formulas.
Col Sum sums up the individual entries of a column - and as @Thierry_S indicates, you need a column with ones to count the rows. But actually, you don't need a real column, instead of a column, you can also specify "1".
If you just want to count rows which are NOT excluded, use:
New Column( "non excluded",Formula( Col Number( If( !Excluded(), 1 ) ) ))
The complicated syntax is necessary because by default the Col ... aggregation doesn't respect the excluded state - it uses all values of the column and therefore counts all rows.