OK I gotcha now.
For me I would just max out the AC you can get with the Shield spell at 25. But I can see if you don't want to do that, then your solution of just applying to one attack seems right. To scale, just let it apply to one more attack for each 2 levels above 1? So applies to 2 attacks for a 3rd level slot, 3 attacks for 5th level slot, 4 attacks for a 7th level slot, and 5 attacks for a 9th level slot?
Yes.
Now, one of the rules of 5e is you want to make wording less annoying.
Wording it so that the spell only works on the triggering attack at level 1, but gets an extra attack for each higher level, makes the "at higher level" wording awkward.
At the same time, I don't want the cloth-casters to be significantly worse off than they where before either.
...
I'll try wording it:
An invisible barrier of magical force appears and protects you from attacks and magic missiles.
While this barrier is active you gain a +5 bonus to AC, have resistance against damage from all attacks, and are immune to damage from magic missile.
The barrier lasts until the triggering attack, or magic missile spell, finishes.
At higher levels: For every spell slot level higher than 1st used, the barrier lasts for up to one additional attack or cast of magic missile that targets you, or until the start of your next turn, whichever comes first.
I guess that isn't too bad wording wise. I was worried adding extra "stacks" would make at-higher levels suck. But it doesn't seem to.
Now the 1st level shield works against 1 attack or a magic missile spell. At higher levels it soaks up to 1 additional attack.
Getting resistance against the attack if it hits is added to make for it not working on more than 1 attack as a 1st level slot; while the times you'd cast it when it would make the attack miss are now not-as-good, the extra opportunity to use it to half-soak a critical hit makes it as good on average on a fragile cloth caster.
Attacks after the first you can't know if they'd have missed. This version soaks more damage per later attack than the original one does, it just doesn't last against as many attacks (even when upcast). This fits my goal of encouraging upcasting shield (making the spell scale with higher level slots).
This looks like a better spell overall for a non-AC optimizing spellcaster (a "cloth caster"), and for a (non-dip) hexblade warlock (their free higher slot levels are used; and a 5th level shield spell is now +5 AC for 5 attacks and resistance if it hits, better than a 1st level shield usually). It is a worse spell for a high-AC tank, but still good.
It also has a good "fiction feel"; the wizard who shoots up a defensive barrier, which is smashed through by the dragon, and the wizard gets hurt (but just less than they would without the barrier).