Question: are you trying to reroll any 1s, or are you treating any 1s that are rolled as a 2? Those are two different things but it looks like you're trying to do both.
If you simply want to reroll 1s then the macro is pretty simple:
[[[[1+?{What Spell Level?|2|3|4|5|6|7|8|9}]]d6r]]
But if you want to treat all rolled 1s as 2s, then that isn't so simple, because the 'kh' will apply to the full die roll, not each individual roll.
So for a 2d6 roll like this:
[[{[[2d6]],2}kh1]]
The 2 is being compared to the 2d6 result, not each individual die roll. If you get a 1 and a 3 on the dice rolls, then the two is being compared to a 4, not the 1 and 3 separately.
To compare a 2 against each die, you'd have to construct this:
[[{[[1d6]],2}kh1 + {[[1d6]],2}kh1]]
So to put it in a full macro where you roll (1+1)d6 per level (with html substitutions) looks like this:
[[?{What Spell Level?|
2,{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1|
3,{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1|
4,{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1|
5,{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1|
6,{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1|
7,{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1|
8,{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1|
9,{[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1 + {[[1d6]],2}kh1}}]]
Or you can create a comparison with a grouped roll (with html substitutions):
?{What Spell Level?|
2,[[{1d6,1d6,2d1,2d1}kh2]]|
3,[[{1d6,1d6,1d6,2d1,2d1,2d1}kh3]]|
4,[[{1d6,1d6,1d6,1d6,2d1,2d1,2d1,2d1}kh4]]|
5,[[{1d6,1d6,1d6,1d6,1d6,2d1,2d1,2d1,2d1,2d1}kh5]]|
6,[[{1d6,1d6,1d6,1d6,1d6,1d6,2d1,2d1,2d1,2d1,2d1,2d1}kh6]]|
7,[[{1d6,1d6,1d6,1d6,1d6,1d6,1d6,2d1,2d1,2d1,2d1,2d1,2d1,2d1}kh7]]|
8,[[{1d6,1d6,1d6,1d6,1d6,1d6,1d6,1d6,2d1,2d1,2d1,2d1,2d1,2d1,2d1,2d1}kh8]]|
9,[[{1d6,1d6,1d6,1d6,1d6,1d6,1d6,1d6,1d6,2d1,2d1,2d1,2d1,2d1,2d1,2d1,2d1,2d1}kh9]]}
I think the first one has a prettier output (it just shows up in a yellow box), whereas the second one will always show up in a blue box. But the second one has a more 'readable' tooltip, which may be handy if you want to see what all the rolls actually were.
There may be a way to do this that I'm not aware of, so if someone comes along with some elegant macro then just ignore all of this!