I don't see this as particularly risky. By far a larger risk is the shackle at the end or the block at the top (if its a spinnaker halyard). I do not depend on the shackle, and tie off the harness to the line. I do not go up on a spinnaker block or the like without some backup.
But on the main or spare halyard: the line is operating at about an 80x safety factor. The winch at around 20x. It has three independent pawls, each of which will easily hold the load. Sheave at the top is rated for 12,000 lbs, and even if it disappeared, the line would only drop a few inches before being caught by the sheave box (internal halyards). I keep at least three wraps on the winch.
You are risking your life about 1000 times more driving down to the boat to work on it.