doc_setTagLeaders

References:

Autodesk.Revit.DB.IndependentTag - This method forms a tag relationship to the host object.

TextNote Leader Alignment - the building coder

The script can be downloaded here.