you can use BlockActivation(), which will bypass the normal activation of your object. it will still run whatever OnActivate event you have in the script though
example, if you use BlockActivation on a container (it has to be called some time before the OnActivate event, such as OnCellAttach or OnInit). when the player activates it, it will make a "fail" sound effect, but still fire the Event OnActivate block of the script in its entirety without opening the inventory menu screen