Has anyone involved with production on the show ever talked about what the ending was planned to be from the start, if it was changed, or if it ended as was always the idea?
Viewers who abandoned it accused them of not knowing what they were doing and buying time with diversions.
They've pretty much admitted that they made things up as they went along, though the broad strokes of a "fight between good and evil, light versus dark" was there from the start as
@BTG says. The concept of the island as a cork for evil was an early idea, as was the idea of the island moving. They knew in season 1 that they wanted the show to end with Jack's eye closing, with Vincent by his side. They outline a lot of that in Vulture's
oral history of the finale with quotes from various people involved in the show.
If I recall correctly though, Damon also secretly hoped the show would get cancelled after 13 episodes back in season 1, so it would be seen as this little cult show like Firefly that never had a proper conclusion, instead of being burdened with answering everything. After the show launched and smashed out of the gate, they had to start thinking about making the show function long-term. Carlton was brought in as a co-showrunner alongside Damon, as Damon was suffering from depression after the loss of his dad and JJ got the Mission Impossible III gig. Damon's said he was "terrified" and broke down sobbing the day LOST premiered dd.
They had some ideas for what the show would evolve into but it wasn't until the "writers camp" they held in between seasons that they came up with some of the answers to the core mythology for the show - who was in the hatch, DHARMA, etc. Then when they got a go-ahead from ABC mid-season 3 to write towards an ending, the show started introducing elements that would be important to the endgame - Jacob, the Man in Black, Widmore's crew.
Personally I don't think it really matters whether they made things up as they went along. The great thing about mysteries is that there's always going to be multiple interpretations and theories and the answers are often much lamer than the questions themselves. Damon's also said they wanted to avoid "midi-chlorian" type reveals that explain the particulars of the island's science, which is probably why the show was also so interested in "science vs faith" as a concept. The known vs the unknown. The numbers for instance could be explained as magic lotto numbers, a psychological test by Dharma (how many times can Desmond type in those numbers until he goes insane?), a mathemagical equation to determine the end of the world (the Valenzetti equation), the hatches' serial number, the numbers for Jacob's candidates or just a plain ol' coincidence that somehow connects all of these people's lives. The times they tried spoon-feeding audiences the answers rarely worked (the whispers are the island's lost souls!), so I liked that the show mostly kept it metaphorical and abstract, more open to individual interpretation than one definitive way of looking at the world.
I think if you're going to be a functional, long-running TV show you need to be flexible, especially when you're doing a serialized, mystery-driven show. As I said earlier, Ben and Desmond's extended roles were products of improvisation when they saw what the actors could do, not something they had planned beforehand. They had to cut Eko's arc short when Adewale hated living in Hawaii (some elements of his original arc were given to Locke). Season 4 was truncated due to the writers strike, etc. Even for the series finale they had to improvise as ABC found their original plan of ending with a fight on the island's volcano too costly. The show kind of thrived on that kind of spontaneity and problem-solving (though the endgame for the show certainly would've been more exciting had they been able to convey the stakes more properly).
I much prefer that kind of "planned, but always open to changes" approach to something like How I Met Your Mother, which tacked on the ending they had originally planned for the show, instead of organically changing it to fit what the show had turned into 9 seasons later.