I agree the dance scene looks very much like the Bond dance sequences. During my previous research I read the script of Legion is so specifically created, every detail is in there for a reason.
According to The Hollywood Reporter's interview with Aubrey Plaza:
The therapist sessions and the showdown with David aren't even Plaza's
only big swings of the episode. A quarter of the way through the hour,
Lennie breaks away from her office desk and embarks on a dance number
set to a Bassnectar remix of Nina Simone's "Feeling Good." Lennie's
silhouette dances across red and black backgrounds, before the
flesh-and-blood version of the character swings through hospital
rooms, shreds pillows to pieces, and eventually calmly resumes her
work. Plaza says there was "a very minimal description in the script
for that sequence," boiling down to a single sentence.
"It went something like: 'Lennie dances with malevolent joy — a dance
of the wild things,'" she remembers. "It was something like that; I
don't want to quote Noah exactly there, because I'm not sure. But it
was a very descriptive sentence, and I just took that and ran with it.
I came up with a mini music video in the middle of the show. I knew
what the song was and I knew the sets I was going to be on, and I just
worked with a choreographer and tried to let loose."
So, it is possible that Aubrey Plaza took things into her control and made the scene something out of a Bond movie dancing sequence. But it is obvious that the scene is not taken from any Bond movie.
Here is the source.
Update: She didn't know it was going to be in James Bond-style.
“I didn’t know how they were going to edit it,” she says. “I didn’t
know there was going to be a James Bond-style silhouette thing either.
I shot a bunch of sequences on the sets of David’s memories, and then
did a dance sequence where it was just me in a green room surrounded
by green screens on all sides. Our schedule was so insane, we had to
fit those sequences in when we could. It wasn’t ‘One day is the dance,
and then I don’t have to think about it anymore!’ It was a lingering
kind of thing.”
Source from Walt's comment.