The problem is that once you enter the while True loop, you are no longer waiting for mouse events coming from pygame. Try checking for new events right before looping:
for event in pygame.event.get(pygame.MOUSEBUTTONDOWN):
mx, my = pygame.mouse.get_pos()
if 375 <= mx <= 425 and 500 <= my <= 550:
run = True
while run:
# statements
# ...
for event in pygame.event.get(pygame.MOUSEBUTTONDOWN):
mx, my = pygame.mouse.get_pos()
if 300 <= mx <= 350 and 500 <= my <= 550:
run = False
You can filter directly the events in the event.get call.
Note that I rewrote the boundary checks, as the logic and in Python is actualy and, while & is a bitwise operation. Python allows for a cool syntax when checking ranges too!