I also converted/wrote a script to retrieve the installed ProductKey to match it with the OEM key.
This works most of the time.
If the retrieved key is VK7JG-NPHTM-C97JM-9MPGT-3V66T then the Windows 10 installation was either upgraded from a previous OS version or the OA3 key allows the OEM machine that originally had a OEM (OA2) marker in the BIOS for Windows 7 or 8 to be used for Windows 10.
So in that case you'll find a OA3 key using your code, but the Activation process changed it into the above mentioned key.

Anyway, the retrieval code for installed license only works for Windows 8 and above (8, 8.1 and 10) because MS changed the way to retrieve the code from Windows Vista and 7.
 Code:
$=SetOption("wow64alternateregview","on")
$reg = ReadValue("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion","DigitalProductId")
Dim $arrKey[]

$i=1
While ($i < LEN($reg))
  ReDim Preserve $arrKey[Ubound($arrKey)+1]
  $arrKey[Ubound($arrKey)] = Val("&"+SubStr($reg,$i,2))
  $i=$i+2
Loop

? "Installed Key: "+ConvertToKey($arrKey)

Function ConvertToKey($Key)
  ;Check if OS is Windows 8 
  $isWin8 = ($Key[66] / 6) And 1 
  $Key[66] = ($Key[66] And &F7) Or (($isWin8 And 2) * 4) 
  $KeyOffset = 52
  $i = 24
  $Maps = "BCDFGHJKMPQRTVWXY2346789"
  Do
    $Current = 0
    $j = 14
    Do
      $Current = $Current * 256
      $Current = $Key[$j+$KeyOffset] + $Current
      $Key[$j + $KeyOffset] = ($Current / 24)
      $Current = $Current Mod 24
      $j=$j-1
    Until $j < 0
    $i = $i-1
    $KeyOutput = SubStr($Maps, $Current+1, 1) + $KeyOutput
    $Last = $Current
  Until $i < 0

  $keypart1 = SubStr($KeyOutput, 2, $Last)
  $insert = "N"
  $KeyOutput = SubStr($KeyOutput, 2, LEN($KeyOutput))
  $KeyOutput = Join(Split($KeyOutput, $keypart1),$keypart1+$insert)
  If $Last = 0
    $KeyOutput = $insert+$KeyOutput
  EndIf

  $ConvertToKey=SubStr($KeyOutput,1,5)+"-"+SubStr($KeyOutput,6,5)+"-"+SubStr($KeyOutput,11,5)+"-"+SubStr($KeyOutput,16,5)+"-"+SubStr($KeyOutput,21,5)
EndFunction