This code generates an ascii maze of up to size 30x30. If you try to generate a larger maze then you will likely run out of stack space. There is no way to increase the size of the stack in vbscript.
Each cell in the maze is represented by a string of five characters such as "11110". The first four chars represent whether a wall is present ("1") or absent ("0") in the four directions "UDLR". The fifth char represents whether a cell has been visited ("1") or not ("0"). Each cell maintains its awareness of the four walls bounding it. When you move from one cell to the next, each cell must have its corresponding wall cleared. So from the point of view of the cell you are movng from, you must set its corresponding wall char to "0" as well as the wall in the next cell, which would be the cell in the opposite direction. For example, if you are moving right one cell you must clear the "R" wall ("11100") in the current cell, and the opposite, or "L" wall ("11010") in the cell you are moving to.
We keep visiting cells in random directions until we end up in a cell that has no "next" cell, either because we are at the edge of the maze, or all neighbouring cells have already been visited. Each time we visit a new cell we push down one more level in the recursion. At a dead end we pop out (backtrack) until we find a direction that hasn't been explored yet.