This is correct, but usually spacing out implies she should be focusing on something else, like work or a conversation.
In this sense, ぼんやりしてもいい may translate better to
"Sometimes, she needs time to let her mind wander." or "Sometimes she needs time alone with her thoughts."