Lua AI: make persistent data variable work with external CAs

It was previously being set correctly by the engine, but was not
accessible from the Lua AI.