His code mean keeping his word. No matter what he does he would of broken his code. He never drops it when it suited him. The very predicament he was in forced him to break his code.
.....look, I'm not sure why the first half of everything I say seems to keep going over your head but let me repeat. Yes, regardless of his actions he was fucked. However, his oath to his empress was made first and to a vastly more important person. Ergo, it was the one he should've kept, not only as a chevalier but as her champion. He had to break one regardless, but "he chose poorly"

In regards to the eluvians, yes, they can transport stuff...if you have elves doing the transporting. So they only benifit elves, and if the orlesians wanted to completely stop the elf rebellion, they'd smash the hell out of every mirror an leave them stranded an without any actual bargaining chips or advantages. Because to use them at all would require loyal elves...,which seem to be in short supply.
Edit: seriously, you somehow manage to skip a sentence or two in each of my posts. Yes eluvians are useful...to elves. That is it. If elves are rebelling, they're an active detriment to orlais(the mirrors). So they should be smashed. Or the rebellion should, either or.