so if you want the lines between some selection
>>>bpy.data.texts[0].lines[0].body
...this is the first line of your text object
>>> [line.body for line in bpy.data.texts[0].lines[4:8]]
['line 5', 'line 6', 'line 7', 'line 8']
>>> selection = [line.body for line in bpy.data.texts[0].lines[4:8]]
>>> for line in selection: print(line)
...
line 5
line 6
line 7
line 8