Made some new improvements to fix some bugs, will post everything when it works.
I'm stuck atm with
_object setVariable ["Code",_code,true];
_keycode = _object getVariable["Code","0"];
If I try to get the value of it with
diag_log format["KIKYOU DEBUG: Value of _keycode: %1",_keycode]...