I am most grateful for all the answers. As an interim solution I will work from the simplest to the more complicated to see me through the rest of the sailing season, beginning with eliminating the swivel at the yard.
At the end of the season I will rethink the arrangement and take lessons from the wisdom contained above. Regaining a marina berth with the sail jammed at the masthead is not something I want to repeat. Other marina berth holders thought I was merely showing off the merits of the rig because I am the only Chinese rigged boat in the area!
I have long stopped coiling ropes on my boats, preferring to flake. I have also talked to mountaineers, who know about ropes. When they throw a rope over a cliff face, it has got to unravel. The told me that coiled ropes may unravel, but too often they do not. Flaked ropes pretty well always unravel, they say.
I first thought that twist in the halyard rope itself was responsible. I removed it, laid it out, untwisted it to the best of my ability and re-roved it - all to no avail. So I bought a new halyard, laid it out, untwisted it, roved it - again all to no avail. Annoying and expensive.
I should have consulted on this forum first, so another lesson learned.
Again, thank you all. Don