Currently the virtual arsenal will effectively reset the loadout of the unit, including wiping all variables. The current "arsenalOpened" and "arsenalClosed" event handlers do not offer a way to cache any data held in variables tied to a unit's loadout. The current work-around is to modify the onLoad function for the config of the lowest display control id in order to ensure a function can be called to cache these variables when the arsenal is opened, however this is not scalable when multiple mods need to achieve it. Adding a BIS scripted event handler for "arsenalPreOpen" which is called before the display is created would offer a scalable work-around.
Examples of current onLoad line workaround:
ACE Gunbag
TFAR Radios