The multiplication order does matter, because the game usually rounds the numbers at every step instead of using decimals or floating point numbers. Ice gems are a power modifier, which means it's applied before the game multiplies the power by Vanilluxe's special attack and everything else you listed. After that multiplication, the game applies the critical hit, STAB, and type effectiveness in that order. So your random order turned out to be correct.
source