Without seeing the exact script, it's hard to be much help. However, a way to not repeat questions is to "load" your questions into a separate file or else a custom (hidden) window in a random order, then do the questions in order from that new location. Once you get to the end, just remove the questions from the new location and "reload" them randomly again. This will keep them random and you'll never repeat a question until all questions have been asked.
As for the blank questions, you'll have to debug your script to find the cause. Maybe you have questions that are formatted badly or blank lines in your questions file.