There are lots of undecided voters in what perhaps is the strangest election I've ever witnessed. People from both sides are saying voting for a third party is a wasted vote. If all of the undecided voters and Bernie supporters voted for a third party, what the chances of them getting elected?
The most likely way that this could happen would be for the election to go to the House and for the Democrats (who are a minority in the House) to join with some disaffected Republicans to elect the third party candidate over Donald Trump.
It is conceivable that this could happen through tactical voting as well. If a third party makes it into the debates and spoils the anti-Trump vote in enough states, it is conceivable that they could switch from Hillary Clinton to a compromise candidate like Gary Johnson. Then we'd be talking about a vote for Clinton being a vote for Trump.
It seems like you may prefer a candidate like Bernie Sanders. That seems highly unlikely, as Sanders isn't working for either scenario. And the former scenario would require Democrats to vote for the primary loser over the primary winner. And Sanders is unlikely to get more support from Republicans than the more moderate Clinton.
Jill Stein (actually running) has the same problem. She might make for a spoiler in Trump's favor, but she couldn't draw Never Trump Republicans.
In order for a third party to win, the candidate will have to appeal to both Republicans and Democrats. If Sanders and Ted Cruz weren't able to win the primary, then why expect them or candidates like them to win a general election over the more moderate Trump and Clinton?
Note: Trump is often described as an ultra-conservative, but by Republican terms he is actually rather moderate: for Planned Parenthood; for increased domestic spending; against foreign interventions; against free trade. Those are all positions associated with Democrats and some moderate Republicans. And that's ignoring his past positions on healthcare, taxes, and gun control that he has since repudiated. His conservative positions are on immigration and law enforcement. Admittedly his rhetoric is often more radical than his other positions would suggest.
If the short-term outcome of preventing your least popular choice from attaining power is the priority, then, yes, voting for a third party is a wasted vote.
If the short-term outcome is to get that third party into power that election cycle, then, yes, probably it's a waste to cast your vote for someone who has little to no chance of winning.
If the longer view is to help to build a party to where it becomes a more viable option and eventually can be viewed as a #1 or #2 option, then, no. The ability of third parties to be taken seriously, get funding, be included in debates or even get onto the ballot is often driven by the level of support shown for those parties. The only way they get enough support is for enough people to "waste" their votes and make them part of the discussion.
If the longer view is that you want one of the major parties, closer to your own viewpoints, to move to espouse you viewpoints more strongly, then, no, it's not a wasted vote. If a party assumes a level of support based on "we don't need to change our platform, what are they going to do, vote for the 'evil' choice, or not vote against the 'evil' choice?" and then they lose to a candidate they considered to be an inconceivable choice, then the reality that they can't assume support from people by ignoring their priorities and being marginally better than the worst choice hits home. This could spur that party to actively court those votes by putting in a platform, policy initiatives and leadership that speaks to the disaffected voters' priorities.
The problem with applying that to the OP's specific scenario, is that undecided voters will have different reasons for being undecided, and the spectrum of Bernie or other third-party supporters all prioritize behind very different third parties, candidates and agendas. For them to unite monolithically behind a single candidate (which is what it would take to get them elected) who probably does not represent the same priorities, for many of them, would be to defy the very traits that make them independent, third-party or undecided in the first place. If those priorities could be set aside for some other goal, then they'd possibly be, for many, supporting the major party that aligns closer to their views.
The rule of plurality in individual states makes it essentially impossible. The only scenario that seems to even come close is where another member of a major party enters and wins enough states to keep both candidates from winning 270 electoral votes and then the house selects the person with only a few electoral votes. This was discussed this year in reference to Romney entering to do nothing but win Utah and then be selected by the house.
In any case, it would take a lot of maneuvering after the votes were counted to even convince the house electing someone who only won one or a handful of states should be nominated.
The best way to answer this is to look back at the last time a third party defeated an established party. The Whigs who ended in the mid-19 century was the only time this happened (I assume you are referring to presidential elections as there are senators, congressmen and governors who are independent).
I would submit that unless all the ingredients present in that event are present now, a third party vote is a waste if electing an independent is the goal. It is not a waste if you are hoping to make a statement (e.g. Ross Perot)
In order for a third party to triumph though, one of the other major parties must collapse so that you have both politician leaving that party and voters angry enough to abandon the party and vote for the third party (recent examples of people abandoning a party resulting in low voter turn-out, not active participation)
What does it take for a party to die (according to historical events)? I will list the ingredients that killed the Whig party and current analogs. I will give examples that both major parties are similarly vulnerable to dying.
The party is stuck re-playing oldies but goodies: The Whigs became protectionists and opposed expanding into the west, The democrats at the time proposed moving west and annexing Texas. Recent analogs: The Clintons for the democrats: look at the good ole days of prosperity in the 90s and continuing the Obama legacy, for the Republicans: a litany of candidates that have also ran before and wouldn't win (Guiliani, Mccain, Kasich, Romney)
A mayor historical issue where the status quo is not a choice: The Whigs were luke warm to a solution to slavery even though the writting was on the wall. They stayed on the fence with compromise after compromise. There is no analog to slavery in the current climate but the question of immigrants and racism is major enough, it is even a world problem. The traditional answer from "establishment" (not Bernie) democrats is closed their eye and hope for the best for example DACA, democrats let these people in the country and then did not give them outright resident status but made them return and re-apply every 2 years. Establishment Republicans wanted to return to the oldie of amnesty but no permanent solution.
The Whig's poster boys died and there was no substitute: Henry Clay and Daniel Webster, leaders of the party died and the popular General that replced him wasn't all that popular. Clintons are not dead but may be tainted, Kennedys are dead (as far as those that would be in presidential politics). The establishment Republicans are in their 80s and 90s and while not dead, would any republican vote for McCain knowing his medical issues?
So the ingredients are there but may not be strong enough or may take longer than I will be alive, but historical forces often surprise contemporaries. The other thing to remember for those who care is that a large group of establishment Whigs became republican (Don't look at the name, it was just the third party at that time) so beware of establishment politicians bringing back the Bad-Old-Days.
Bonus Ingredient: Populist Candidates put the final nail in the Whig coffin. Frankling Pierce, hated by both Whigs and Establishment Democrats started doing radical things. Particularly filling posts with people from both parties in an effort to unite Americans. This went badly for him in the newspaper as both sides of slavery issue accusing him of being pro-the-other-side. Currently we have Bernie and Trump (I know Bernie didn't have a prayer in the primaries but he is still very much in the minds of average people). Two politicians that don't want the establishment in power anymore. They want to do things. They are both not idealist in their own parties but are populist. That is getting the support of the voters and not the elite. A further word about Bernie, he is tainted and it is doubtful that he will ever win a primary, but Zuckerberg is just as radical and a populist that does not owe anything to the establishment. The republicans do not have a Zuckerberg, but a lot of things can happen in 3 years.
Votes, protests and promotions are iterative energetic things, they wax and wane over time, (i.e. in the course of a populace's voting lifespan). Relative to such energies, politicians are like phototropic plants, and as plants need light to exist, so do parties and their pols grow or wither by where we direct our votes.
It seems more irrational to expect things to never change, or believe that significant and necessary changes must either occur ex nihilo, or not at all. Most social changes tend to come about somewhat gradually, or do but appear to be sudden after the public reaches its tipping point.