This is how I would code it:
Local $sPlaintext = "I'd like to translate a piece of C++ code into AutoIt. Well,the C++ source is a CTRL+C & CTRL+V for me, I don't really know how it works, that's why I can't really translate it. Well, my huge fault, but still, this code would be really important for me!" & @CRLF & _
"So, it's a simple XOR encryption. Another problem is that I can't yet understand, how the hell it work (I mean wtf is this XOR)... Well, I'm trying to learn it, but meanwhile I post this topic. Here's the C++ source:"
Global $sPad = "Could anyone confirm me? Just because it's not working too..."
Local $sCiphertext = _Vernam($sPlaintext)
ConsoleWrite("Ciphertext: " & Binary($sCiphertext) & @LF & @LF)
ConsoleWrite("Recovered plaintext: " & _Vernam($sCiphertext) & @LF)
Func _Vernam($sIn)
Local $aIn = StringToASCIIArray($sIn)
Local $aPad = StringToASCIIArray($sPad)
Local $sOut
For $i = 0 To UBound($aIn) - 1
$sOut &= ChrW(BitXOR($aIn[$i], $aPad[Mod($i, UBound($aPad))]))
Next
Return $sOut
EndFunc
Anyway, keep in mind that your key definitely needs to be at least as long as the plaintext, must be used only once and needs to have pretty good randomness. All criterions that this toy example misses. Forget any condition and you're going to be severely bitten.