Some additional information:
If a Pokemon is inflicted with Encore and Taunt simultaneously (and it's in the above situation, where it is locked into Swords Dance or any other status move) then the Pokemon will start to Struggle. Note that in a single battle, due to the timing of the moves, there will only be one struggle turn; after that, the Encore will end, and since Struggle cannot be Encored, the Pokemon has one turn to do whatever it wants.
Here is a test showing it with SD Garchomp and Whimsicott. After both Encore and Taunt were inflicted (and one turn where Garchomp can't use Swords Dance due to Taunt) Garchomp struggled for one turn, then the Encore ended. Whimsicott attempted to Encore Garchomp again, but it cannot stop Garchomp from KOing it with Earthquake.
TLDR: If both Encore and Taunt are inflicted at the start of a Pokemon's turn, and that Pokemon is locked into a status move, it will struggle.