I think the logic here isn't working as you intend due to a lack of parens:
if event is InputEventMouseButton and $Origin.rect_position.y > -709.9 or $Origin.rect_position.x < 0.1:
I assume that needs to be:
if event is InputEventMouseButton and ($Origin.rect_position.y > -709.9 or $Origin.rect_position.x < 0.1):
Note, I just added a set of parens. Without those around the position checks, you'll get inside that if
block unexpectedly...
Specifically, your logic is essentially this:
if thing_one and thing_two or thing_three
Without parens, that'll be TRUE in either of these cases:
thing_one and thing_two are TRUE
-or-
thing_three is TRUE
With the parens, the logic only returns true in this one case:
thing_one is TRUE and (either thing_two or thing_three is TRUE)