As a generic response. Good AI is darn difficult to make, even those huge budget AAA games often have quite bad AI characters that quite often do more harm than good. So, any easy/simple answer that would work on all situations ain't likely to be found.
Addendum: For this particular case.
I am not 100% sure what kind of game you are making.. so this my advice may indeed be totally useless to you.
For starters I would consider making the scene grid and turn based, that way it would be easier to be sure that the heros and enemies would not stomp atop of each other and also all players on the field do their movements and attacks in manageable fashion.
If you want them to have pixel (or sub-pixel) positioning, you'll need to define whom the characters want to attack? Perhaps the weakest enemy, or the closest or spice up with some randomness?. Also you'll must be sure that the characters won't get stuck (if movement fails)...
Oh. I got the nasty feeling, there should be at least I more tutorial of this AI.