Alla fine ho sistemato così:

function xtract()
{
return dict[Math.floor(dict.length * Math.random())].toLowerCase();
}

function getText(n)
{
var s = xtract();
while (s.length > n) {s = xtract();}
return s;
}

Ho pubblicato sopra al precedente.
Grazie BR. :sexpulp: