Maybe you need a cool-down timer.
So when after open (or close) the inventory screen:
1) create a global flag, for example is_active = false which will cause your script(s) to ignore input, for example
if Input.isactionjustpressed("openinventory") && is_active:
2) start a short timer. On timer complete, set the flag is_active = true so input will be accepted again