Neat, been playing with your function. To determine the "default" value suggest you just use the "ReadValue" function with a "null" parameter for the value - that returns the default value ...

 Code:
FUNCTION LogKeys($ext)

   DIM $ft, $key, $app, $sh,$x,$y
   DIM $CT
   $key = $base + $ext
   $CT = 0

   $x = $base + $ft + "\Shell\Open\Command"

   If keyexist($x)
    $sh = readvalue($x,"")
   Else
    $ft = ReadValue($key,"")
    $x = $base + $ft + "\Shell\Open\Command"
    If keyexist($x)
     $SH=readvalue($x,"")
    Endif
   Endif

   $= WriteLine(2,$ext+","+$sh+@CRLF)

EndFunction