One way to do that if you don't need the normal behaviour of labeltitle
(so this idea is probably a non-starter with author-title-based styles) would be to reconfigure labeltitle
resolution so that you get back the desired type of title
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber]{biblatex}
\DeclareLabeltitle[article]{%
\field{journaltitle}
}
\DeclareLabeltitle[inbook,incollection,inproceedings]{%
\field{booktitle}
\field{maintitle}
}
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
\addbibresource{biblatex-examples.bib}
\begin{document}
\citetitle{sigfridsson}
\citetitle{worman}
\citetitle{nussbaum}
\citetitle{geer}
\citetitle{pines}
\printbibliography
\end{document}

If the labeltitle
solution does not work for you, you will have to roll a manual version of that approach.
The following implements a \petercitetitle
that usually prints the title
field, but can be configured to print a different field for on a per-type basis.
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber]{biblatex}
\DeclareFieldFormat*{petercitetitle}{\mkbibemph{#1}}
\DeclareCiteCommand{\petercitetitle}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifbibmacroundef{peter:citetitle:\strfield{entrytype}}
{\printfield[petercitetitle]{title}}
{\usebibmacro*{peter:citetitle:\strfield{entrytype}}}}
{\multicitedelim}
{\usebibmacro{postnote}}
% you can define exceptions to printing 'title'
% for type <type> by defining a bibmacro called
% 'peter:citetitle:<type>'
% the macros usually have the same structure, so this
% could be packed up into a macro
\newbibmacro*{peter:citetitle:article}{%
\printfield[petercitetitle]{journaltitle}}
\newbibmacro*{peter:citetitle:inbook}{%
\printfield[petercitetitle]{booktitle}}
\letbibmacro*{peter:citetitle:incollection}{peter:citetitle:inbook}
\letbibmacro*{peter:citetitle:inproceedings}{peter:citetitle:inbook}
\addbibresource{biblatex-examples.bib}
\begin{document}
\petercitetitle{sigfridsson}
\petercitetitle{worman}
\petercitetitle{nussbaum}
\petercitetitle{geer}
\petercitetitle{pines}
\printbibliography
\end{document}

Here \strfield{entrykey}
is similar to what your \getentrytype{<key>}
would do (except it always applies to the current <key>
, you can't easily extract the entry type of an entry that is not currently being processed, you'd have to switch over to that entry with \entrydata
).