It's a bit more complicated than that. Many experienced trainers will try and predict switches; if you switched to your ground pokemon vs. the electric, you would probably quickly find out it also has Aerial Ace or something equally annoying. Just about every pokemon can learn moves which are offtype and still do significant damage with them, and the most versatile (Hidden Power) can be any element you want. I agree, switching is going to be the most difficult part.
To be effective, the AI will have to calculate roughly what the opponent's pokemon is. Educated guessing can get 50% or more of the moveset and item (and further observation improves), while guessing EVs is a bit more difficult. You'd have to reverse-calculate its Speed from whether it goes before you, its Attack from how much damage it hits you for, etc. At first this will be a range of values, but you can probably narrow it down to within 2 or 3 stat-points. This will help developing a strategy against it immensely.
As for 'what move do I pick', the AI would first have to work out what its own moveset is meant to do. You could pre-define this, but it would be better if it could work it out itself. Once that's done, check for simple cases like "opponent has 1 pokemon left and I can kill it" or "opponent is trapped, badly poisoned and I have Detect". Most of that time that will fall through and you'll go to the next step, "is my opponent going to switch? what will he switch to? what do I do then?" Difficult question - especially the second part if you don't know their party beforehand. Next would be "how do I execute my moveset's strategy?" This part is relatively simple. :)
I wish you luck! I did a bit of analysis on this myself, but didn't get to the programming stage.