Used modified code below on my XP Pro machine and it worked fine. Moved the test value from the UserID key to the UserIDX key.

code:
 
$profilelocation = "HKEY_CURRENT_USER\test1\test2"

$tmpfile=%TEMP%+'\OLProf.dat'

$save=$profilelocation+"\"+@UserID
$Load=$profilelocation+"\"+@UserID+"X"
SaveKey("$Save", "$tmpfile")
AddKey("$Load")
sleep 3
LoadKey("$Load", "$tmpfile") ; This line fails!
? @Error
? @Serror