Which is more important for protein expression mRNA structure or codon optimization?
This is an excellent question! To my knowledge, there hasn't been a definite answer yet. Recently, I did tons of research on which factors influence protein expression and you should definitely check out the following questions which I asked: 


What is the criticality of the ribosome binding site relative to the start codon in prokaryotic translation?
What determines a successful protein expression in E. coli?


I answered my second question by posting a concise version of a paper from DNA2.0 (a gene synthesis company) that discusses the protein expression. It summarizes all the important factors (RBS site, codon frequency match, 5' mRNA secondary structure), but it doesn't discuss the extend to which they influence expression. 

There is a nature paper from Voigt lab about RBS calculator, which takes into account only the 5' mRNA secondary structure and it doesn't discuss at all the codon-optimization. The calculator was good, but far away from perfect: there is a 50% chance of predicting an expression level within a 2-fold range of the target one.

On the other hand, an older paper from DNA2.0 argues that the mRNA is covered with ribosomes practically all the time, so the secondary structure of the mRNA should have little effect. Besides, an actively translating ribosome can break up stem-loop structures.

In my opinion, we are still far off from predicting RNA secondary structure formation, although it might be highly implicated in protein expression. From what I read, I think that it is equally crucial that there is no strong secondary structure at the 5' end of the mRNA, the RBS sequence is close to the consensus one and it it appropriately spaced upstream of the start codon, and the first 60-100 codon frequencies match the frequency of your heterologous host.