A possible solution...depending on how/where you plan to use your family.
The text should be a nested family, with an instance parameter for the text itself. This will allow it to be constrained to a reference plane/line. Place this family four times in your host family with the spacing as desired (pay attention to the scale, set to 1). As soon as one of the visible parameters is switched to off then correponding dimension is going to 0.
Then there is one issue remaining...scaling. As text will size depending on scale in view. So you should add a multiplying parameter in your family. The distance between your text should be multiplied by a factor depending on the scale of your view. Unfortunately the family can not read the scale of your view so you would have to set this value yourself. This also means that if this family is shown in multiple views with different scales it can only show properly at one scale.
A workaround for this might be to make use of different sub-categories (e.g scale50, scale100) in your family. Duplicating your texts in the family and assigning them to the different sub-categories. In your project you can then switch of the unneeded sub-categories.
Depending on how you want to use the family it can get messy and the users will need to understand how the family works.



Other route is to make use of a Dynamo script.
Louis

Please mention Revit version, especially when uploading Revit files.