Turn to Vertice Select Mode by Script

The Script should mark some vertices, which satisfies a certain condition.
The marking works only, if i have switched ‘manually’ to the vertex-select mode before i start the Script.
All other modes forget the selected vertices, as soon, as i update the mesh.

How can i turn to another select mode in a script, or is there an other solution to mark the Verts ?