It looks like your Pecil needs some memory, so it can disregard repeated contacts with the same collider multiple times in a row.
This is related to the idea of "debouncing" a switch - the input to our systems, especially when they come from players or physics - can be messy. The mouse cursor might hover just at the border of a zone for several frames, alternately entering and exiting. So we often need to make our trigger responses "sticky", by remembering we've been activated, and requiring a larger action to deactivate/reset, something called hysteresis.
void OnTriggerExit2D(Collider2D other)
// Disregard collisions with anything but our points.
if(other.gameObject.CompareTag("Point") == false)
// Disregard repeated visits to the same point.
if(other == _lastPointTouched)
// Toggle our writing state, and remember this point for future events.
writing = !writing;
_lastPointTouched = other;
If you want, you can clear this memory if a condition is met (like the mouse button/touch is released, or the pencil gets far enough away, or if a certain amount of time passes) to allow starting a new line at this point when the player does so deliberately, without accidentally triggering it from a brushing contact.