References are written to the .aux file and reread again. Partial expansion of commands is possible, e.g. ~ becomes \nobreakspace{}. Therefore the redefinition of \theequation adds \protect in front of ~ to prevent expansion.
The following example uses a parser for comma separated lists:
\documentclass{article}
\renewcommand*{\theequation}{eq.\protect~\arabic{equation}}
\usepackage{kvsetkeys}[2011/03/03]
\usepackage{refcount}[2010/12/01]
\makeatletter
\newif\if@IfRefList
\newcommand*{\IfRefList}[2]{%
\@IfRefListfalse
\def\IfRefList@key{#1}%
% \comma@parse{#2}\IfRefList@test
\begingroup
\csname @safe@activestrue\endcsname % babel shorthands
\edef\x{\endgroup
\noexpand\comma@parse{#2}\noexpand\IfRefList@test
}\x
\if@IfRefList
true%
\else
false%
\fi
}
\newcommand*{\IfRefList@test}[1]{%
\IfRefUndefinedBabel{#1}{%
}{%
\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter\IfRefList@entry
\expandafter\expandafter\expandafter{%
\getrefbykeydefault{#1}{}{}%
}%
\ifx\IfRefList@key\IfRefList@entry
\@IfRefListtrue
\comma@break
\fi
}%
}%
\makeatother
\begin{document}
\begin{equation}
2+2=4 \label{aaa}
\end{equation}
\begin{equation}
3+3=6 \label{bbb}
\end{equation}
\begin{equation}
22+22=44 \label{zzz}
\end{equation}
\begin{center}
\newcommand*{\test}[1]{%
\texttt{\detokenize\expandafter{\string#1}} & #1\\%
}
\begin{tabular}{l@{ $\rightarrow$ }l}
\test{\IfRefList{eq.~1}{aaa,bbb,ccc}}
\test{\IfRefList{eq.~4}{aaa,bbb,ccc}}
\test{\IfRefList{eq.~2}{aaa,ccc}}
\test{\IfRefList{eq.~1}{bbb,aaa,ccc}}
\end{tabular}
\end{center}
\end{document}

And an example with a parser for semicolon separated lists:
\documentclass{article}
\renewcommand*{\theequation}{eq.\protect~\arabic{equation}}
\usepackage{refcount}[2010/12/01]
\usepackage{etoolbox}
\DeclareListParser*{\SemicolonForeachParser}{;}
\newif\ifIfRefList
\newcommand*{\IfRefList}[2]{%
\IfRefListfalse
\def\IfRefListKey{#1}%
% \SemicolonForeachParser\IfRefListTest{#2}%
% Expansion of #2
\begingroup
\csname @safe@activestrue\endcsname
\edef\x{\endgroup
\noexpand\SemicolonForeachParser\noexpand\IfRefListTest{#2}%
}\x
\ifIfRefList
true%
\else
false%
\fi
}
\newcommand*{\IfRefListTest}[1]{%
\IfRefUndefinedBabel{#1}{%
}{%
\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter\IfRefListEntry
\expandafter\expandafter\expandafter{%
\getrefbykeydefault{#1}{}{}%
}%
\ifx\IfRefListKey\IfRefListEntry
\IfRefListtrue
\fi
}%
}%
\begin{document}
\begin{equation}
2+2=4 \label{aaa}
\end{equation}
\begin{equation}
3+3=6 \label{bbb}
\end{equation}
\begin{equation}
22+22=44 \label{zzz}
\end{equation}
\begin{center}
\newcommand*{\test}[1]{%
\texttt{\detokenize\expandafter{\string#1}} & #1\\%
}
\begin{tabular}{l@{ $\rightarrow$ }l}
\test{\IfRefList{eq.~1}{aaa;bbb;ccc}}
\test{\IfRefList{eq.~4}{aaa;bbb;ccc}}
\test{\IfRefList{eq.~2}{aaa;ccc}}
\test{\IfRefList{eq.~1}{bbb;aaa;ccc}}
\end{tabular}
\end{center}
\end{document}

Update: Expansion of the list added for the case that the list is given as macro.
cleveref, the command\crefafter redefinition of\theequationwith\protectworks incorrectly; (2) it is not clear how to use\IfRefListin\ifthenelsecommand: the code\ifthenelse{\IfRefList{eq.~1}{aaa,bbb,ccc}}{included}{not included}does not work (also if I replace the first argument with\equal{\IfRefList{eq.~1}{aaa,bbb,ccc}}{true}). Could you please help me? – Andrew Oct 22 '12 at 13:23cleveref, make a bug report. And rethink your approach with the redefinition of\theequation. Depending on the goals, the loaded packages there might be better ways. (2)\boolean{IfRefList}. – Heiko Oberdiek Oct 22 '12 at 17:30\crefthe problem is already clear. If I remove~, an incorrect result appears even for the standard\ref. Surprisingly, everything works correctly even without\protect! However, there is a new problem (Sorry!). If I define\newcommand\String{aaa,zzz}and use it as\IfRefList{eq.~1}{\String}the result is alwaysfalse. Can this problem be fixed? – Andrew Oct 22 '12 at 22:10\Stringonce before passing it to\IfRefList. – Heiko Oberdiek Oct 22 '12 at 23:09