Here is a C# macro that opens a selected family in the family editor, adds a new type parameter to the family, sets the value of the parameter, and loads the family back into the project.
I have tested this on Generic Annotation families, althought I have not managed to set the value of type parameters for families that have multiple types. I assume another line of code may be needed to set the current family type.
Note the difference between the Document doc used for the original project, and the Document docfamily used in the family editor, and the locations they are used in the transactions and in the commands.
Also, don't let the iFamilyLoadOptions overwhelm you. For a macro, just paste that section of code in right after the macro's #endregion line , and just before your first macro (basically just as shown below.) You can obviously change the overwriteParameterValues to enable or disable automatically overwriting existing families.
Text examples: Here are a couple of sample lines of code that show how to get the text and location of a textnote, and how to place a textnote. A textnote should be selected before running this code.