Does your basil.js play nice along with ID's native Extendscript? If so, you can use this:
var allFonts = app.fonts.everyItem().getElements();
b.textFont( allFonts[Math.floor(Math.random()*allFonts.length)] );
The first line accesses the live app.fonts object in InDesign, and since this is slow I prefer to use the everyItem().getElements()
trick to 'convert' it to a static array first. Typically you would do this only once, near the start of your script.