I am not sure if I understood the question correctly. You can give your options to a particular matrix in several ways: using a scope environment:
\begin{scope}[<options>]
<code for the matrix>
\end{scope}
or passing the options to the optional argument for the particular matrix:
\matrix[<options>]
<code for the matrix>
The general options can be passed to the tikzpicture environment or using a \tikzset command.
Here's a modified version of your code that I think produces the result you are trying to achieve:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{
positioning,
calc,
shapes.geometric,
matrix}
\begin{document}
\begin{tikzpicture}[
line/.style={
draw,
thick,
-latex
},
status/.style={
rectangle,
draw=black,
text centered,
anchor=north,
text=black,
minimum width=2em,
minimum height=2em
},
m2style/.style={
column sep=1em,
row sep=1em,
nodes={status},
font=\bfseries
},
mstyle/.style={
column sep=10em,
row sep=3em,
nodes={status},
font=\bfseries
}
]
\matrix (m) [
matrix of nodes,
ampersand replacement=&,
mstyle,
row 1 column 1/.style={nodes={fill=green}},
row 1 column 2/.style={nodes={fill=red}},
row 1 column 3/.style={nodes={fill=yellow}},
row 2 column 3/.style={nodes={fill=gray}},
row 2 column 2/.style={nodes={diamond}}
]{
H & A1 & A2 \
& {} & D \
};
\matrix (m2) [
right=1.8cm of m,
draw=black,
matrix of nodes,
ampersand replacement=&,
m2style,
column 2/.append style={nodes={text width=1.5cm}},
]{
|[fill=green]|H & Healthy \
|[fill=red]|A1 & Infected \
|[fill=yellow]|A2 & Infected \
|[fill=gray]|D & Death \
};
\draw[line] (m-1-1) -- (m-1-2) node[pos=0.5,above,align=left] {$#\mathrm{A1} \geq 1$ or\$#\mathrm{A2} \geq R$};
\draw[line] (m-1-2) -- (m-1-3) node[pos=0.5,above] {wait $\tau$ ticks};
\draw[line] (m-1-3) -- (m-2-3) node[pos=0.5,right] {wait 1 tick};
\draw[line] (m-2-3) -- (m-2-2) node[pos=0.5,above] {$p_\mathrm{replenished}$};
\draw[line] (m-2-2) -| (m-1-1) node[pos=0.2,above] {$1-p_\mathrm{infected}$};
\draw[line] (m-2-2) -- (m-1-2) node[pos=0.5,left] {$p_\mathrm{infected}$};
\path let
\p1=(m2.east),
\p2=(m2.west)
in
node[align=center,text width=\x1-\x2,anchor=south,inner sep=0pt]
at ([yshift=5pt]m2.north)
{The title for the legend box};
\end{tikzpicture}
\end{document}

Remark
After a comment, a title was added to the legend box. The title was set in a node whose width is automatically calculated to be equal to the width of the matrix for the legend (this requires the calc library).
In case the title should be inside the legend box, I'd suggest another approach not using a matrix of nodes for the legends, but simple nodes and the fit library:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{
positioning,
calc,
fit,
shapes.geometric,
matrix}
\begin{document}
\begin{tikzpicture}[
line/.style={
draw,
thick,
-latex
},
status/.style={
rectangle,
draw=black,
text centered,
anchor=north,
text=black,
minimum width=2em,
minimum height=2em
},
m2style/.style={
status,
font=\bfseries
},
mstyle/.style={
column sep=10em,
row sep=3em,
nodes={status},
font=\bfseries
}
]
\matrix (m) [
matrix of nodes,
ampersand replacement=&,
mstyle,
row 1 column 1/.style={nodes={fill=green}},
row 1 column 2/.style={nodes={fill=red}},
row 1 column 3/.style={nodes={fill=yellow}},
row 2 column 3/.style={nodes={fill=gray}},
row 2 column 2/.style={nodes={diamond}}
]{
H & A1 & A2 \
& {} & D \
};
\begin{scope}[
node distance=1em and 1em,
mytext/.style={m2style,text width=1.6cm}
]
\node[m2style,fill=green,right=2cm of m.north east] (H) {H};
\node[m2style,fill=red,below=of H] (A1) {A1};
\node[m2style,fill=yellow,below=of A1] (A2) {A2};
\node[m2style,fill=gray,below=of A2] (D) {D};
\node[mytext,right=of H] (he) {Healthy};
\node[mytext,right=of A1] (in) {Infected};
\node[mytext,right=of A2] (inf) {Infected};
\node[mytext,right=of D] (de) {Death};
\path let
\p2=(H.west),
\p1=(he.east)
in
node[align=center,text width=\x1-\x2,anchor=south west,inner sep=0pt]
(title)
at ([yshift=5pt]H.north west)
{The title for the legend box};
\end{scope}
\node[draw,fit={(title) (D) (de)}] {};
\draw[line] (m-1-1) -- (m-1-2) node[pos=0.5,above,align=left] {$#\mathrm{A1} \geq 1$ or\$#\mathrm{A2} \geq R$};
\draw[line] (m-1-2) -- (m-1-3) node[pos=0.5,above] {wait $\tau$ ticks};
\draw[line] (m-1-3) -- (m-2-3) node[pos=0.5,right] {wait 1 tick};
\draw[line] (m-2-3) -- (m-2-2) node[pos=0.5,above] {$p_\mathrm{replenished}$};
\draw[line] (m-2-2) -| (m-1-1) node[pos=0.2,above] {$1-p_\mathrm{infected}$};
\draw[line] (m-2-2) -- (m-1-2) node[pos=0.5,left] {$p_\mathrm{infected}$};
\end{tikzpicture}
\end{document}
