You can set them to a value read from a heightmap or from wherever, but this won´t effect the meshs representation within the engine, just the output. And you can´t set the vertex positions in one frame and add to those positions in another frame, what you can do is just setting them to whatever value you want within the vertex shader, which is processing each vertex every frame the mesh is rendered.
If you want for example an "endless terrain" which is always moving with the player and reads the vertices height values from a heightmap, you can do this very fast in a shader, while doing this in your script would be really slow.