it allows me to know what I can and cannot do and what I should or shouldn't allow into my space
This is such a great way to describe it. Our ego is constantly telling us who we are, and the good thing is that we can change it as we grow and learn.
A healthy ego allows me to be confident in myself even when I think I'm flawed
Exactly, our ego can help us overcome that negative self-talk.