In short, you cannot nest code in verbatim or verbatim in code because they are both terminal (end of the line for nesting). In fact you can't nest anything inside them by their very nature. Anything inside of them cannot have special functionality, even escape codes don't play well in that part of the grammar. There is no way around this because you cannot nest inside things that are by definition terminal. However, from your examples it seems that you can get the effect you are looking for using ~is~ =verbatim= ~in code~.