All this code seems a bit complex. It appears to me that you are only trying to find the total bytes used in a particular home directory. Although this particular code takes (a few seconds) longer, why not use something like this:

code:
$path = "h:\"
$totalsize = 0
$tempfile = "%temp%\00000000.tmp"
shell ("%comspec% /c dir " + $path + " /b /a-d /s > " + $tempfile)
If OPEN(1,$tempfile)=0
While @error = 0
$size = GETFILESIZE(READLINE(1))
$totalsize = $totalsize + $size
Loop
IF Close(1)= 0
DEl $tempfile
Endif
Endif
"Total bytes = " + $totalsize
?
"Total Kbytes = " + ($totalsize/1024)
?
"Total Mbytes = " + ($totalsize/1048576)

I'm sure someone else will shoot down this idea, but essentially, I'm running a bare (/b) dir command and outputting the file names to a temporary file. Then, I am reading each file name from the file and getting the filesize. These sizes are added to find the total space used by files in that particular directory tree.

Brian