Assuming Plain TeX, you can define
\long\def\begincommand#1 \endcommand{...}
but this will force you to write
\begincommand
Text to be stored
\endcommand
with \endcommand on a line by itself or
\begincommand
Text to be stored \endcommand
with a space between the last word and \endcommand (but no empty line before \encommand). Alternatively, you can define
\long\def\begincommand#1\endcommand{...}
and then do something about the possible final space when \endcommand is on a line by itself. One should know the context, in order to give better advice.
If you're using LaTeX, this is not good programming style. If what you're looking for is an environment form for a "definition", then the environ package suggested by Leo Liu is handy, but poses some challenges for defining a command that uses the environment's body to be used subsequently.
\usepackage{environ}
\NewEnviron{command}{%
\long\xdef\surroundedtext{%
\unexpanded{<pre>}%
\unexpanded\expandafter{\BODY}%
\unexpanded{<post>}}%
}
Thus the code
\begin{command}
Text to be stored
\end{command}
will be equivalent to
\newcommand{\surroundedtext}{<pre>Text to be stored<post>}
Add whatever you need in place of <pre> and <post>