I believe the answer is
The maze in the Mazerunner series
I've tried to explain each line, but to be honest, I haven't read the books or seen the movies...
It shifts and move before their sights
It rumbles with shifting every night
The walls of the maze change every night
Within its walls many are long trapped
The characters are all trapped inside a maze
Running through its corridors in hope
"Runners" move through the maze quickly, keeping track of the changing walls
Eight ways and for one man each
The maze is divided into eight sections
To find a way out in their reach
They run as fast as they can to cover as much ground as possible
Flesh and metal lurk in the night
Creatures in the maze know as Grievers
Doors shut them at sunset's sight
At night, doors shut to keep Grievers out of the Glade
Get in before they close at last
Or your death won't be so fast
If runners are not back by night, they have to face the nocturnal Grievers
It took a mind bright to see the pattern
The main character realized the maze changed according to a pattern
Before they left the halls of ivy and fern
The maze is made of tall concrete walls covered in ivy
Thought they would never come back again
But others in mind had other plans
The characters did not plan to ever return but the WICKED organization had it planned that they would need to return (see below)
Many they took, for special they were in mind
A group of "Immunes" were taken who were immune to a brain disease central to the book
And locked them in the walls in and behind
They were locked inside the walls of the maze which the earlier group had escaped from
When a lad found out from a turn of a book
When a main character wakes from a procedure, he finds a note (connected to book?) telling him he needs to free the Immunes
He led a long rescue and had one last look
He proceeds to go back to the original maze (one last look) and rescue them
It's stone walls last seen in moments of flight
After the rescue, they escape the maze in a last "flight"
As it crumbles and falls in last sight
As they are doing so, the walls explode