Could Bernie run in the 2020 primaries as a Democrat and as an Independent?
In the US, an independent is not a member of a separate party (at least in most states) and does not compete in primaries. An independent gets on ballots in individual states by collecting signatures. Only the Democrats and the Republicans participate in primaries to choose the delegates to their conventions. And only the Democrats and Republicans are guaranteed a ballot spot in the general election for whatever candidates their conventions choose.
Sore loser laws would block a candidate from appearing in both the primaries and the general election in two states (Texas and South Dakota).
You should also remember some other very good arguments against Bernie Sanders doing this. First, it would tend to fragment the general election vote. Second, Sanders would be 79 in 2020, the oldest presidential candidate ever. It seems likely that Sanders would support a different candidate, possibly Elizabeth Warren, rather than running again himself.
Also note that not every state will fuse the two candidacies together. So in some states, Bernie Sanders, Democrat and Bernie Sanders, Independent would be two separate candidates for the purpose of vote counting. As the referenced question explains, it would work in states like California and New York but not everywhere.