A preliminary solution, not finished so far!
\documentclass{book}
\usepackage{etoolbox}
\usepackage{xparse}
\newcounter{sectionlevel}
\makeatletter
\NewDocumentCommand{\currentdepth}{sO{}m}{%
\IfBooleanTF{#1}{%
}{
\ifnum\value{sectionlevel} = -1
\part[#2]{#3}%
\else
\ifcase\value{sectionlevel}
\chapter[#2]{#3}
\or
\section[#2]{#3}
\or
\subsection[#2]{#3}
\or
\subsubsection[#2]{#3}
\or
\paragraph[#2]{#3}
\or
\subparagraph[#2]{#3}
\else
Oopss!
\fi
\fi
}
}
\NewDocumentCommand{\nextdepth}{sO{}m}{%
\stepcounter{sectionlevel}
\currentdepth[#2]{#3}
}
\NewDocumentCommand{\previousdepth}{sO{}m}{%
\addtocounter{sectionlevel}{-1}
\currentdepth[#2]{#3}
}
\makeatother
\AtBeginDocument{%
\setcounter{sectionlevel}{0} %
}
\begin{document}
\tableofcontents
\currentdepth{Hello World}
\nextdepth{Hello World - Section}
\currentdepth{Hello World - Section - Again}
\nextdepth{Hello World - Subsection}
\previousdepth{A section again}
\previousdepth{A new chapter}
\end{document}
Edit Improved version, with starred and optional versions working, and the \previousdepth<-3>{...} possitibility to jump back 3 levels (or whatever.
No real checking about allowed levels is done!
\documentclass{book}
\usepackage{etoolbox}
\usepackage{xparse}
\usepackage{letltxmacro}
\newcounter{sectionlevel}
\makeatletter
\NewDocumentCommand{\currentdepth}{som}{%
\LetLtxMacro\generic@@section\relax%
\ifnum\value{sectionlevel} = -1
\global\LetLtxMacro \generic@@section\part
\else
\ifcase\value{sectionlevel}
\global\LetLtxMacro\generic@@section\chapter
\or
\global\LetLtxMacro\generic@@section\section
\or
\global\LetLtxMacro\generic@@section\subsection
\or
\global\LetLtxMacro\generic@@section\subsubsection
\or
\global\LetLtxMacro\generic@@section\paragraph
\or
\global\LetLtxMacro\generic@@section\subparagraph
\else
Oopss!
\fi
\fi
\IfBooleanTF{#1}{% Is it the starred version?
\generic@@section*{#3}%
}{%
\IfValueTF{#2}{%
\generic@@section[#2]{#3}%
}{%
\generic@@section{#3}%
}%
}%
}
\NewDocumentCommand{\nextdepth}{som}{%
\stepcounter{sectionlevel}%
\IfBooleanTF{#1}{%
\currentdepth*{#3}%
}{%
\IfValueTF{#2}{%
\currentdepth[#2]{#3}%
}{%
\currentdepth{#3}%
}%
}%
}
\NewDocumentCommand{\previousdepth}{sD<>{-1}om}{%
\addtocounter{sectionlevel}{#2}%
\IfBooleanTF{#1}{%
\currentdepth*{#4}%
}{%
\IfValueTF{#3}{%
\currentdepth[#3]{#4}%
}{%
\currentdepth{#4}%
}%
}%
}
\AtBeginDocument{%
\setcounter{sectionlevel}{0} %
}
\begin{document}
\tableofcontents
\currentdepth{Hello World}
\nextdepth{Hello World - Section}
\currentdepth{Hello World - Section - Again}
\currentdepth*{Hello World - Section - Again - but starred}
\nextdepth{Hello World - Subsection}
\previousdepth{A section again}
\previousdepth{A new chapter}
\nextdepth{Yet another section}
\nextdepth{Yet another subsection}
\nextdepth{Yet another subsubsection}
\previousdepth<-3>{And this is a ...?}
\end{document}

\chapter{#1}, if it is 2, you do\section{#1}, etc. In the end command, you decrease the counter again. – Thomas Weise Jul 23 '15 at 12:22