I require two new commands, \createreference and \citereference, to work with. They should work as shown in the following examples:
\createreference{john}{John Q. Citizen} should write the text “John Q. Citizen” into the file myreferences.aux. The text should be somehow associated with the corresponding entry john.
\citereference{john} should print out “??” if no john entry can be found in myreferences.aux (or if the file doesn’t exist). However, it should print out the corresponding text (in this case “John Q. Citizen”) if the entry is found.
This should work even if \createreference appears after \citereference in the code.
I don’t have enough low-level expertise to be able to do this. Does someone else?

\def\reserved@a{#2}%to\edef\reserved@a{#2}%as in the update – Boris Oct 30 '12 at 15:54