\settowidth command, which sets a width equal to the width of some text, is described at Get width of a given text as length and How to set the width of the label of a description to the width of a string of text in ConTeXt?. What is the plain TeX equivalent of this command?
[Tex/LaTex] the plain TeX equivalent of \settowidth
There is none other than doing the same thing by copying the LaTeX definition:
so transformed into
and the trick is done, assuming you already allocated