Macro definitions are considered as the "replacement text" for the given "macro and argument". So, with a definition like
\newcommand*{\setfooter}[1]{\def\mypackage@footer{#1}}
the use of \setfooter in your code is replaced with \def\mypackage@footer{#1}. If \setfooter is [not] inside a group, then \def\mypackage@footer{#1} will also [not] be inside that group. So, if the usage the macro and its eventual replacement is not required globally (outside the group), you don't need to declare it globally (with a \gdef or \xdef).
Here's a small example highlighting the above discussion:
\documentclass{article}
\newcommand{\mymacro}[1]{\def\myothermacro{#1}}
\newcommand{\mygmacro}[1]{\gdef\myothergmacro{#1}}
\begin{document}
\begingroup% Start a group
\mymacro{test1}% Local definition of \myothermacro as test1
\endgroup% End a group
\show\myothermacro% \myothermacro is undefined
\mymacro{test1}% Local definition of \myothermacro as test1
\show\myothermacro% \myothermacro is defined as test1
\myothermacro% test1
\begingroup% Start a group
\mygmacro{test2}% Global definition of \myothergmacro as test2
\endgroup% End a group
\show\myothergmacro% \myothergmacro is defined as test2
\mygmacro{test2}% Global definition of \myothergmacro as test2
\show\myothergmacro% \myothergmacro is defined as test2
\myothergmacro% test2
\end{document}
which yields the .log output of
> \myothermacro=undefined.
l.8 \show\myothermacro
> \myothermacro=macro:
->test1.
l.10 \show\myothermacro
> \myothergmacro=macro:
->test2.
l.16 \show\myothergmacro
> \myothergmacro=macro:
->test2.
l.18 \show\myothergmacro
Note that \myothermacro is undefined on l.8, since its definition was local on l.6 (inside a group). \myothergmacro, however, is defined as test2 on l.16, since it was globally defined (or \gdef-ed) on l.14.
It is also possible to precede the required global definition with \global, if its needed. So, in the above example, using
\global\mymacro{test1}
would translate to
\global\def\myothermacro{test1}
which is equivalent to
\gdef\myothermacro{test1}
Note that some commands "transcend" groups. See, for example, Why do \setcounter and \addtocounter commands have global effect, while \setlength and \addtolength commands obey the normal scoping rules?