In the writing phase of masters thesis, is it advisable to take a course that is unrelated?
This is more a way for you to think through your dilemma than an actual answer. Only you can provide the answer.
In theory, there is no reason why a single course should interfere. But in practice it depends on how much time you have and how close is the deadline. Only you can evaluate the parameters.
It is good to keep flexible, and a good analysis course might serve your long term interest well. But so will finishing your thesis on time.
It depends on the level of risk you are willing to take on, and whether you have any safety valves if you get backed up.
I'll also note that focusing too much for too long on one thing doesn't use your mind very efficiently. Sometimes if  you get blocked on one thing it is good to take up something else for a while and you mind may well work through the block unconsciously. It is also why physical activity is good at &quot;block&quot; points.