what should you answer to your potential supervisor's question: Are you applying to other programs? I had an interview with a potential Ph.D. supervisor, and along the way, he asked whether I am intending to apply to other similar Ph.D. programs? I said: Yes, but that's because I don't know how admissions work.
Was that a good answer? What is supposed to be done in such situations?
Also, when the professor says: Ok, I will work with you to write the best competitive statement of purpose. Does that mean he is going to accept you?
The obvious answer to the first is that you will apply until you are accepted into a suitable and interesting position. For the second, it has no implication other than that he is interested. He is willing to give you advice, but your admission can depend on several things. The SoP is only one of those.
In some cases, depending of place and field, the professor may not be directly involved in decisions to accept you. But nothing is assured until you get an acceptance letter.