One can use commands inside \ul as long as they expand completely to characters; so
\ul{Some text \thecount}
works. It's really not possible to use other commands, apart font switching and accent making ones; a list of preregistered commands of that kind is already included in soul, but others can be registered
\soulregister{\myfontswitch}{1}
if, for example, you have
\newcommand{\myfontswitch}[1]{\textbf{\scshape\small #1}}
(just to give a silly example). But, for example,
\newcommand{\mytext}{\mbox{xyz}}
will give Reconstruction failed without \soulregister{\mytext}{0} and no underline with it.
\thecount? :) But, above all, avoid underlining. – egreg Jan 25 '12 at 9:40