It is not really needed. $availableSpace is not the overall disk space but the available space for your versions which by default is 50% of your current free space. Since the new version is already count in it is OK to stop if all the available space for versions is used by versions.