She should be able to get into the broom cupboard by passing through all 40 rings in the third Quiddich test.
The library should have been open to her pretty much from the start when Ron tells you about Draco Malfoy running into the library with Hedwig and you have to rescue her.