Adding IF statement to function causes RANDOM(3) to always return "2"?

// statement below.  Now, every result is 2.

while (jitter_count < 25) {
    random_roll = random(3);

if (random_roll = 2) {

Well, you assigned 2 to random_roll, so the code IS behaving correctly.

== is the comparison operator.