TEXTBLOCK width can be 0 to automatically calculate the width, or you can give a value, and that will be used.
You can later place that texblock with RICHTEXT2, so there is the place for transformations if the width is automatic.
Also you can return values from macros using RETURNED_PARAMETERS, maybe the width calculation is better to be done in the macro.
We have a tutorial about TEXTBLOCK:
Library Platform, Software Engineer