*edit
Sorry, misunderstood what you wrote. Yes, the order in the raws list matters, as the entry number that corresponds to the red sand entry will be switched with the white sand entry.
If the array was post sorted after being populated, there would be no difference, because the same entites are in the list, just differenly ordered. Entry X would always be value Y, because the sort algo would always put it there.
Eg, the list "abe, apple, aquel" will alphabetically sort to "abe, apple, aquel", regardless of the input order.
Alphabetical post sort with the same 3 members results in member #3 always being "aquel". The fact that the above test shows that switching the inputs results in a change, shows that the array is not post sorted. Just appended as read.
That is why red and white sand were switched, and stayed that way over worldgen.
Next, I will switch gabbro with obsidian. Obsidian is clearly "special", since it specifically lines magma tubes. If I get gabbro lined tubes instead of obsidian after swapping the entries, and regenerating, then I think I win.
I conjecture that toady's algorithms favor certain sections of the array for "common" minerals (copper, for instance), over uncommon ones (iron ore, both igneous intrusive members), and may even hard call member entries in certain cases (obsidian).
Hence the revised test above. If I get gabbro lava tube walls, it's game over.
*edit again
Nope. Obsidian must be specially tracked. Swapping gabbro with obsidian and regenerating had no effect. Good for toady!
I will switch gabbro with some other igneous intrusive stone.
Success. Swaping Granite for Gabbro successfully swapped the layers over worldgen.