You would think that I would know better than to mess with an egreg solution, but in my defense I used a DavidCarlisle solution from \setbox vs. \sbox and \savebox - What are the differences I need to know about? to adapt egreg's solution to Proper way to detect empty/blank text.
This has worked fine for me up until now, but when I attempt to use it within an enumerate environment it results in it gobbling up the item number:

Note that the item number is not gobbled for the case where there is no title to be used (Third Item).
If I replace the \sbox0{\begingroup\vbox{#1}\endgroup} as per the original solution:
\sbox0{#1}
this particular MWE work, but causes problems elsewhere (not shown here).
Question:
So, what is the minimal change I could make to the existing \sbox0 solution so that the item numbers is not gobbledr?
I am disabling some macros within the \begingroup so as to eliminate any side effects so do need the grouping.
Code:
\documentclass{article}
\usepackage{enumitem}
\makeatletter
\newcommand{\DoIfNonEmptyText}[1]{% Actually takes two parameters
%\sbox0{#1}%
\sbox0{\begingroup\vbox{#1}\endgroup}%
\ifdim\wd0=\z@\relax%
\expandafter@gobble%
\else%
\expandafter@firstofone%
\fi%
}%
\makeatother
\newcommand{\QuotableText}[3][]{%
% [#1] = optional title
% #2 = name for this (not relevant for this example)
% #3 = the content
\DoIfNonEmptyText{#1}{\textit{#1}:~}%
#3%
}%
\begin{document}
\begin{enumerate}
\item First Item
\item \QuotableText[Sub title]{Text One}{Second Item}
\item \QuotableText{Text Two}{Third Item}
\item Fourth Item
\end{enumerate}
\end{document}
Update:
Based on Frank Mittelbach's answer, I attempted to use my own \savebox, but it still exhibits the same output as above:
\makeatletter
\newsavebox{\@DoIfNonEmptyTextBox}%
\newcommand{\DoIfNonEmptyText}[1]{% Actually takes two parameters
\begingroup
\savebox{\@DoIfNonEmptyTextBox}{\vbox{#1}}% -- This still gobbles the item number!
%\savebox{\@DoIfNonEmptyTextBox}{#1}% -- This works
\ifdim\wd\@DoIfNonEmptyTextBox=\z@\relax%
\endgroup\expandafter\@gobble%
\else%
\endgroup\expandafter\@firstofone%
\fi%
}%
\makeatother
but if I remove the \vbox{}, then this works just fine. So, how is the use of the \vbox (note: no use of \sbox0 here), causing the enumerate item to disappear?