I would do something a little different. Since you are looking for a random permutation Flatten[{ConstantArray[0,250], ConstantArray[1,250]}]
, I would generate the permutation and use Part
to get the list you are looking for. Properly,
perm = RandomSample[Range[trialNo]]; Flatten[{ConstantArray[0, trialNo/2], ConstantArray[1, trialNo/2]}][[ perm ]]
It does not work in different ways than what you do, but I think that it mathematically reflects what you are trying to achieve better.
source share