Here's a small example that illustrates this issue:
Upon changing of a value of n a script is called that tells Geogebra to generate the divisor list, then to get the length of the resulting list, then this length is copied to a JS variable. Turns out, the JS variable always gets the previous list size from before the list changed.
ggbApplet.evalCommand("DL = DivisorsList(nn)"); ggbApplet.evalCommand("DLsize = Length(DL)"); var listsize = ggbApplet.getValue("DLsize"); alert("listsize: " + listsize);
Interestingly, this problem doesn't occur if instead of the divisor list a sequence is created, even a long one that takes a few seconds to create. Which leads me to belief that the script is actually supposed to wait but something goes wrong in the first case.
Attached are the problematic version with the divisor list and the okay version with the sequence.