Re: Optimal halyard length?
Going up the mast or dropping the mast are the two options. On a 24' boat you might be able to drop the mast with 2 or 3 people quite easily. It's a really good idea to take a close look at all mast rigging and hardware, including halyard sheaves, if you've never done so.
You can use a dyneema core line with a stripped cover, or splice dyneema to double braid, to make a wire-replacement halyard that would work on small size sheaves. The splices aren't too hard to learn, or you can get a rigger to do them for you.
boats that I sail on regularly: Pearson 28-2, Rondar 505, Yankee 30, Blanchard Junior