Well, assuming you know what kind of bytes represent free space (0x00 or 0xFF, depending on the game), I'd ask the user how many bytes to search for, then use a for loop and make it attempt to match up the amount of free space bytes the user defines with a position in the rom. However, that'd be quite a chunk of code to write, and it'd be something beyond the scope of that tutorial.
I wrote a program that scans for particular bytes in a rom, I'd probably have to make a modification of that code to search for free space. As mentioned though, it'd be a lot more code than just a few statements.