Annoying bug in my application

I have a situation in my app, where you have to grab something using one button, then while holding that button, there is a use button to action the thing your holding, (which happens to have a relative rotation set to it), then upon release of the use button, it does the opposite relative rotation to reset the position. All works fine.

The problem I have is: if the player happens to press the use button first, before the grab button, then when they press the grab button and then release the use button, the release code thinks it has already done the press code and is a step into the logic and is adding the opposite rotation to the release function. So the reset is in essence rotated back beyond it’s starting point.

I can’t get my head around the logic which tells unreal only to do the release, if the grab and use have been done in the correct order. I’ve tried setting booleans, but it seems like I need some kind of reset code, to stop a release script happening, in the event that the use button is already pressed, upon pressing action.

I hope this makes, sense, it’s not even easy to explain.