Is that a top-level event? (not a sub-event?) When there is no condition on the left, it means that this event is triggered on every tick. You should never ever use "Wait" action in events that are triggered on every tick!
Create two variables - "previousX" and "previousY", then do this:
If you are making some kind of level builder, then instead of setting/erasing tile it may be better just to move a square sprite to mouse position (snap it to tile coordinates). Then, for example, on left click set the tile at sprite position, on right click erase.