A PGF/TikZ node with the name <name> defines the macro \pgf@sh@ns@<name> (e.g. \csname pgf@sh@ns@#1\endcsname where #1 is the name). This macro
defines the node shape (ns), e.g. rectangle.
Other defined macros are \pgf@sh@np@<name> (Node Point), \pgf@sh@nt@<name> (Node Transformation matrix) and \pgf@sh@pi@<name> (node Picture Id).
You can use e.g. \@ifundefined{pgf@sh@ns@#1}{<node does not exists>}{<node exists>} to test if a node with this name got already define in the document (node are declared globally).
If you want to test if the node was already used in the current picture, you better test (also) the picture id if it matches the current picture id (\pgfpictureid, e.g. pgfid1, i.e. use \ifx for comparision).
Here some possible implementations of such macros (not tested yet):
\def\@nodeundefined#1{%
\@ifundefined{pgf@sh@ns@#1}%
}
% or
\long\def\@nodedefined#1#2#3{%
\@ifundefined{pgf@sh@ns@#1}{#3}{#2}%
}
\def\@nodedefinedcurrpic#1{%
\expandafter\ifx\csname pgf@sh@pi@#1\endcsname\pgfpictureid
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}