Hi,
when defining the field for the count column with the agregate, keep track of the corresponding IEntityField(2) (you may use the IEntityFields DefineField() method rather than the ResultSetField factory overloads)
Then you should be able to inject that field in the sortclause constructor.
Now I think that is the simple way, which is clearly subotpimal, since you don't make use of aliasing.
You may have a look at "Expressions in select lists" from the manual.
Using an expression, you may define your master field as an alias for the agregated column (defined in an intermediate field), and reuse the master field.
Cheers