Or like, you tap S.
It targets (locally, draws a little circle around) the target closest to Straight in front of you. While it's still charging you can tap S again to pick the second priority, or the third, etc.
For example, we have a player with Magic Missle in a room of 5 skeletons.
NPC Code:
Me
1
2 3
4
5
The first choice is the skeleton right in front of the player. The second choice is the one a little further away...a difficult algorythm, but you'd only have to write it once for all targeted spells.
Heck, you could even use the Slow spell's targeting and it'd be an improvement....