First it would be easier if you manually created a custom property inside your Entity class, to return the addition of the OrdersPaid and OrdersUnpaid fields. (make sure you define the new property inside a User Code region "CustomEntityCode", so it won't get overwritten when you re-generate the code)
Then, you should use an EntityView to sort the EntityCollection on the client-side. Using the new entity property as follows:
// Adapter C# example, use EntityView instead of EntityView2 for SelfServicing
EntityView2<CustomerEntity> customerView = new EntityView2<CustomerEntity>(customers);
ISortExpression sorter = new SortExpression(new EntityProperty("TotalOrders") | SortOperator.Descending);
customerView.Sorter = sorter;