You can't use the function secondaryWeapon with this...
What OFP understands with secondary weapon is the LAW/RPG etc slot, not the handgun...
What you can try (in the trigger) is:
Activation: the side you need
present
On Activation: (thislist select 0) selectWeapon "berettaName"
On Deact. : (thislist select 0) selectWeapon (primaryWeapon (thislist select 0))
if you are using an old OFP= On Deact. : (thislist select 0) selectWeapon "sniperRifleName"
I'm not sure that would work, and in any case it wont (most likely) work on player units...