Bernd, it is really necessary to sort the pending Messages but time? The pendingMessages list is not already sorted by default?
Another question: when using repeat for each in CR-delimited list, are we sure the lines order is preserved? In some other languages, the use of each don't preserve the order.
Anyhow, the LC built-on dictionnary is rather inaccurate as it says in resizeStack description:
The resizeStack message is sent after the resizing is finished. This means that you cannot prevent a stack's size from being changed by trapping this message.