What is the correct way to calculate the rate constant for the reaction of NO and O2?
Either definition is acceptable, as long as you clearly identify relationship between the calculated rate value $R$ and the rates-of-change for each of the species in the system.

In case (1), you've effectively calculated the rate constant defined as:

$$
R_1 = k_1\ce{[NO]^2[O2]}
    = -{\mathrm d \ce{[O2]}\over \mathrm dt}
    = -{1\over 2}{\mathrm d \ce{[NO]}\over \mathrm dt}
    = {1\over 2}{\mathrm d \ce{[NO2]}\over \mathrm dt}
$$

In case (2), you've instead calculated the rate constant defined as:

$$
R_2 = k_2 \ce{[NO^2][O2]}
    = -2{\mathrm d \ce{[O2]}\over \mathrm dt}
    = -{\mathrm d \ce{[NO]}\over \mathrm dt}
    = {\mathrm d \ce{[NO2]}\over \mathrm dt}
$$

Both cases accurately describe the kinetics, but you have to be careful to identify which definition of the rate you've used in calculating $k$.