Well, will one of these UDFs work for you any better?

Memory() - Get Physical RAM size - local or remote

MemSize() - returns installed memory size

MemSize2() - Retrieve Physical memory size

And I've placed your code into TAGS to preserved the formatting.

Code:
FUNCTION GETCOMPUTERMEMORY ()
Dim $BaseKey,$RAMTranslated,$RAMAmount
$BaseKey = "HKEY_LOCAL_MACHINE\Hardware\ResourceMap\System Resources\Physical Memory"
$RAMTranslated = RIGHT(READVALUE($BaseKey, ".Translated"), 8)
IF @ERROR=0
$RAMAmount = (VAL("&"+RIGHT($RAMTranslated,2)+SUBSTR($RAMTranslated,5,2)+SUBSTR($RAMTranslated,3,2)+LEFT($RAMTranslated,2))+16371712+1048576)/1048576
IF ($RAMAmount mod 2)=1
$RAMAmount = $RAMAmount+1
ENDIF
$GETCOMPUTERMEMORY = ""+$RAMAmount+" MB"
ENDIF
ENDFUNCTION