How exactly does the reaction between alkyl halides and silver nitrite occur?
The concept of hard and soft acids and bases (HSAB) proved to be
  useful for rationalizing stability constants of metal complexes. Its application
  to organic reactions, particularly ambident reactivity, has led
  to exotic blossoms. By attempting to rationalize all the observed
  regioselectivities by favorable soft–soft and hard–hard as well as
  unfavorable hard–soft interactions, older treatments of ambident
  reactivity, which correctly differentiated between thermodynamic and
  kinetic control as well as between different coordination states of ionic
  substrates, have been replaced. By ignoring conflicting experimental
  results and even referring to untraceable experimental data, the HSAB
  treatment of ambident reactivity has gained undeserved popularity. In
  this Review we demonstrate that the HSAB as well as the related
  Klopman–Salem model do not even correctly predict the behavior of
  the prototypes of ambident nucleophiles and, therefore, are rather
  misleading instead of useful guides. An alternative treatment of
  ambident reactivity based on Marcus theory will be presented.
  
  — H. Mayr’s, M. Breugst’s and A. Ofial’s introductory remark in their review pulished in Angew. Chem. Int. Ed. 2011, 50, 6470. DOI: 10.1002/anie.201007100.


Within the review, in the section on the nitrite ion, the authors give two competing effects that control product distribution.

For electrophiles with an electrophilicity parameter $E &lt; -3$ (the bis-(4-methoxyphenyl)carbenium ion has $E = 0$, lower values are more stabilised carbocations such as bis-(4-dimethylaminophenyl)carbenium) the reactions proceed at equilibrium under thermodynamic control and the product yields are equivalent to their relative stabilities. Since nitro compounds are more stable than nitrite esters, they predominate.

$$\ce{R-ONO &lt;=&gt; R+ + NO2- &lt;=&gt;&gt; R-NO2}$$

For electrophiles with a parameter $E &gt; 0$, the reactions are essentially diffusion controlled, i.e. the free electrophile will capture the first nucleophile it can find. This includes tertiary alkyl carbocations ($E \approx 7{-}8$). The reactions do not go through classical transition states, and any means of describing them via frontier orbitals must fail. That explicitly includes describing them according to $\mathrm{S_N1}$ or $\mathrm{S_N2}$. In these reactions, kinetic control determines that the $\ce{O}$-attack is slightly more likely with $k_\ce{O} / k_\ce{N} \approx 3.4$. (This corresponds to computational models that show a slightly smaller activation barrier for the oxygen attack.)

Reality is more complex than these simple models imply especially for the diffusion controlled reaction. While the attack of oxygen is favoured kinetically, the attack of nitrogen results in less required reordering of the molecule (the two $\ce{N-O}$ bonds would still be identical while they become $\ce{O-N=O}$ in the nitrite ester) which reduces the expected favourism for oxygen. Effects such as solvent and counterion slightly affect the product distribution, and the highest ratio of nitromethane : methyl nitrite can be achieved using $\ce{Bu4N+ NO2-}$ and $\ce{MeI}$ in $\ce{CDCl3}$ (a product ratio of $70\,:\,30$ in favour of nitromethane). Note that $\ce{AgNO2}$ and $\ce{MeI}$ in DMSO yield more methyl nitrate ($54\,:\,46$) although the same electrophile is used. The authors conclude the nitrite section with the statement:


  It should be noted, however, that the selectivities
  shown in [the table presented in the review] are also not related to the hardness of the electrophiles.




Note

Throughout this answer, electrophilicity parameters according to Mayr’s equation are used:

$$\lg k_{20~\mathrm{^\circ C}} = s(E + N)$$

$E$ is a nucleophile-independent electrophilicity parameter while $s$ and $N$ are electrophile-independent nucleophilicity parameters.



Bibliography

A paper related solely to studying the nitrite anion: A. A. Tishkov, U. Schmidhammer, S. Roth, E. Riedle, H. Mayr, Angew. Chem. Int. Ed. 2005, 44, 4623. DOI: 10.1002/anie.200501274.

The review mentioned in the opening, concerning all sorts of ambient nucleophiles often explained via the HSAB concept: H. Mayr, M. Breugst, A. Ofial, Angew. Chem. Int. Ed. 2011, 50, 6470. DOI: 10.1002/anie.201007100.