Writing contents of bpy.data.texts to folder with bpy.ops.text.save
You can find current active text object in screen.areas of text editor
area = next(area for area in context.screen.areas if area.type == 'TEXT_EDITOR')
text_obj = area.spaces.active.text

Assume that you know your text-block name, then assign that text type to active text:
area.spaces.active.text = bpy.data.texts['Text.001']

This will change the current active text object.