Ah, didn't know that about string-to-int.
I was thinking though, one way to do it out of order (although still very variable intensive) would be to assign a variable to each ship with the same number as that ship. I.e. @Cargo-1 = 1, @cargo-2 = 2, etc. You then need a series of sexps that alter the vars arbitrarily highly when the corresponding ship is destroyed, I.e. When cargo 1 is destroyed, @cargo-1 would be modified to equal 100000.
You can then use the same sexp setup as my previous mission (modified with Axem's point about string-to-int), but alter the incrementing sexp to pick the lowest number (using the min sexp, obviously) from the series of variables and insert that in to be concatenated. If you wanted to give some degree of semi- randomness to the system, you could have the sexps then add a rand-multiple to the successful sexp, so that now @cargo-2, for example, might equal 5 or 6, excluding it from sending any more messages for a little while.