Is there a simple way to move an object with animation and with script?

I want to give my object a sort of bobbing effect and be able to update or change its position with script but the animation is forcing its position on the object.

You most likely work the animation on the parent object, so you are setting y position for the bobbing and x, z are set to 0. So the animation repositions to this settings. You need to add an extra parent where the code is stored, then you have children for the mesh or sprites.

 ---Parent  (contains all the main scripts, movement affects that object position)
-------MeshObject (animation affect this object position)

It means now that the bobbing movement is no longer in world coordinates but in local coordinates of the object. The MeshObject will move within the parent object.