Hi Angela,
You don't really have to write DS2 for such a simple logic as sorting by a treatment custom detail. Just assign a "custom detail tag" to this custom detail, and then enable the regular sort-based arbitration based on this tag value, in the treatment assignment window.
But if the logic is more complicated, there is an example DS2 code in SAS RTDM Administration Guide 6.5 - page 173, chapter "Example: Reverse-the-Order Custom Arbitration Process"
Also if your treatments are large (have many custom attributes) and multiple of them are assigned, you should pay attention "Processing Large Amounts of Data in Arbitration" section at page 256 to avoid errors.
Good luck with your SAS RTDM journey!
-------
Dmitriy Alergant, Tier One Analytics