input_event(viewport, event, shape_idx) built into Area2Ds is good for getting single presses, in addition to mouse movement, but in your case where you are checking the button state every frame, I haven't found a good way to use this signal.
Instead, we can use the
mouse_exited() signals to see if our mouse is in the Area2D before checking if our mouse is being pressed.
Connect your Area2D's
mouse_exited() signals to your script, then create a new variable to store if the mouse is inside the Area2D. Your code should look something like this afterwards:
var touch_down = false
var mouse_inside_area = false
if Input.is_action_pressed("ui_touch") and mouse_inside_area:
touch_down = true
touch_down = false
mouse_inside_area = true
mouse_inside_area = false