Because the situation changed.
When she goes up to the house to hang herself, she seems semi-delirious and not in full control of her senses.
She killed Lombard, her lover, because she believed he was responsible for the murders. As the only survivor, besides herself, of the original ten people on the island, he had to be the murderer. That was her reasoning, but perhaps later she came to realise that it wasn't completely sound; perhaps he couldn't possibly have been in the right place at the right time to kill all those people.
When she hears the judge approaching and sees the door opening, she appears to believe it will be Hugo, her previous lover who abandoned her when he understood she was a murderer. This shows, perhaps, that she's not thinking clearly. Why would Hugo show up again in her life in order to murder nine complete strangers as well as get his revenge on her?
So at this point, she's so damaged by what she's been through that she's not thinking straight. As well as leading her to murder Lombard and imagine Hugo is coming for her, this may also have affected her decision to commit suicide.
When she sees the judge,
her whole perception of the events so far changes. If he's still alive, if he was the murderer all along, then not only was she wrong about Lombard, but the events of the past half-day haven't actually transpired in the way she'd thought they had. The support for her decision to commit suicide has fallen away, and the state of play has changed. Perhaps she's been shocked to her senses; certainly she's no longer sure what she wants to do.
Death is irreversible; she wants, at least, to have more time to make her decision on whether to die, taking fresh information into account, rather than dying there and then based on an ill-informed decision made when she wasn't in her right mind.