That's obvious ->
Trigger checks condition: TRUE -> add action
(switch player)
Trigger checks condition: FALSE -> run deactivation (remove action from current player, NOT the player who was given the action)
(switch player back)
Trigger checks condition: TRUE -> add action (again)
Solution: Store the original unit the action is applied to in a global variable, e.g. ActionPlayer = this. Then instead of running the removeaction on the player, run it on Actionplayer ->
Con: player hasWeapon "myWeapon"
Act: myAction = player addAction ["Try Foolproof Action", "actionscript.sqf"]; ActionPlayer = player;
DeAct: ActionPlayer removeAction myAction
Gets messy when you teamswitch to multiple units that have the needed weapon, of course -> you might want to have a separate trigger for each possible unit the action can be added to, and use the unit name instead of Player for adding/removing.
addAction was never a part of the original OFP scripts, it was added later - but before the eventhandler commands. That's probably why it's such a hopeless command to get right >_< Hopefully they fix it to look better for ArmA II (e.g. player addaction ["Name", {eventhandler-like script}])
Final solution: add a teamswitch-monitoring script that removes/adds actions as necessary.