The sentence structure suggests a past continuous tense for the action that was in progress when another action interrupted it. The question "You 7) ... (to smoke) when I 8) ... (to come in)?" implies that the smoking was ongoing when the teacher entered. Therefore, the correct form for the 7th blank is 'were you smoking'.
The correct option is: were you smoking