Thanks to R. Wayne Schmittberger for the following answer to the above
question:
I don't remember the castling question being asked before, or being
settled. But I think that it would be in keeping with the spirit of the
game to allow castling when in check, as well as to allow castling
through check. For the same reason, it should be legal to move into
check, even though your opponent can then win by taking your king.
R. Wayne Schmittberger