My 7 year old daughter has slept 12 hours a night consistently throughout her life. The night following her birth she even slept all night too. Outside of a couple of normal bouts of sleep disruption here and there - illness, restless or excited about upcoming events etc. - she's done super well with sleep.

Over the past week, she's been worried to go to sleep she eventually does so without too much trouble, however... She'll wake up between 4-5am and have a very hard time getting settled again. 

She wakes and immediately wants to get in bed with myself and her mother. If she does so, she settles straight away and falls asleep. We don't want her to become dependent on this though, so we encourage her to get back to sleep in her own bed. Carry her in, tuck her in etc. But she becomes increasingly upset with each attempt. It's heartbreaking, but I feel that becoming too comfortable with doing this, she'll not be able to break from that routine and sleepovers would not be possible for her.

Getting to the root of the issue during chats with her was relatively easy. She gets scared that she can't hear us, or that she thinks she's been left alone. Loneliness has come up at nighttime too. This always results in tummy pain too.

We spent a good portion of last night coming up with a plan for her to follow which she was relatively enthused about.
It was explained that her brain is super busy learning all of her school work and remembering so much (went into much more detail and she was amazed by how amazing the brain is) but because it's so busy, that sometimes it decides to play tricks on us and we can't help feeling a certain way. 

We assured her in every possible way that she could imagine at the time that my wife and I would always be there for her, but sometimes it's nice for her to have time with other members of the family with sleepovers and even holidays with close family etc. 
She was quite reluctant to accept that, but she recognised that she does have a lot of fun in these situations and that took the edge off.

After deducing with her that we're dealing with separation anxiety, we came up with a plan together when her brain tricks her into thinking we're not there.
She came up with a sentence she could say out loud to help keep the thoughts at bay. We allowed whatever words she wanted to stop this... Even "naughty" words. 
She came up with "Stop being silly bastard brain." 
This novelty really improved her mood when initially going to bed... So much so that she went straight to sleep with absolutely no problems at all and in very high spirits.
However, these thoughts seemed to overpower her again regardless and she couldn't settle after waking at 5am. 

We've said that she can peek her head into our room if she likes just to prove to herself that were still there. In hindsight, this probably results in her finding it too difficult to get back into bed afterwards. 
I always wake to get sitting in the bed frame and poking me awake asking to get in bed with us.

I'm just not sure how to help her from here.

We journal each day, listing things that she loved that day and what made her sad. We try to validate her bad feelings and verbally recognise that it's difficult for her, but she recognised the balance in those feelings.
She does play on bad feelings sometimes, but knows she only gets sympathy, recognition and comfort for truly feeling a certain way. She doesn't necessarily get scolded for attempting to lie about feelings, but we know her well enough to catch her in a lie and explain that that's not something we do. For which she apologizes and we thank her for that.

She goes to birthday parties and experiences separation anxiety then too, but once she warms up to the room, she's often one of the most confident kids in the mix.

I'm just stuck for how to help her.