I may be missing something, but can see no way with existing nodes to create text that includes variables, as you can do in OpenSCAD with the str() function.
So I have created a node called val_to_txt which takes an expression to be evaluated and outputs a 2D text object.
I suppose that an alternative approach might be an expression_to_string node, but it would have to delay evaluation of the expression until OpenSCAD run time, so I'm not sure how to do it.
I have included in the attached zip file a small demo .scad file that shows how this can be used to annotate or dimension a model.