On the LilyPond mailing list, I was told that there really isn't a way for this to be done—although the following is a workaround as regards the problem with transposition:
\withMusicProperty #'untransposable ##t \key c \major
This code prevents C major from being transposed.
Another workaround, which I have used, is to use tags, so that transposing scores use different keys than C scores. Here is an overview of tags: http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Different-editions-from-one-source