There are K=1,384,201,395,738,071,424 canonical sequences for N=16. How do you want to do this sampling practically? A one to one mapping of each canonical sequence to some index 0<=x<K which can be calculated in both directions is the only way I see to solve this problem. It may be possible but it doesn’t seem trivial.
What I mean is to calculate the probability of each move at each sampling step, which includes the following steps.
1. First, calculate the number of canonical sequences of length N start with specific face, which are divided into U/R/F and D/L/B according to symmetry. For U/R/F, this sequence should be C_urf = [9, 135, 1782, 23814, ...], and for D/L/B, this sequence is C_dlb = [9, 108, 1458, 19440, ...], and the calculation formula is
C_urf[ i ] = C_urf[i - 1] * 6 + C_dlb[i - 1] * 9;
C_dlb[ i ] = C_urf[i - 1] * 6 + C_dlb[i - 1] * 6;
2. Now start sampling, for example, we want to sample a 15-step canonical sequence. Then for the first move, according to the above calculation, we know that the probability of its face being U/R/F is P(U/R/F) = C_urf[15]/(C_urf[15] + C_dlb[15]). Then we randomly sample a random real number between [0, 1). If it is less than P(U/R/F), we randomly select an face between U/R/F with equal probability, otherwise we randomly select an face between D/L/B with equal probability (of course, we also need to add the random of 90/180/270 degrees).
3. After sampling the kth step, we can continue to calculate the probability of each face appearing in the next move. For example, when the previous face is D, the number of canonical sequences start with specific face that appear in the next move is Count_U=Count_D=0 (since D D, D U is forbidden), Count_R=Count_F=C_urf[N-k], Count_L=Count_B=C_dlb[N-k]. Using the sampling strategy in 2, we can continue to randomly sample the current move.
4. Recursively execute the above steps, and finally the canonical sequence with length N can be sampled with equal probability.