You cannot animate a model with script. You CAN play back any existing animation, but you CAN NOT create a new animation with scripts alone. A script does tell the game engine what the different animations are called and what files they are stored in, but that is all.