Delete only outer vertices from faces in a faces-and-edges-selection selection this is a one shell mesh that is not water-tight, in edit mode. 



The selection was performed as it follows: Select All; Select Boundary Loop; Select More (3 times); Select Less (3 times).

The objetive is to delete the vertices inside the red loop so that the border of the mesh is smoother. Any idea how to do it?
Deleting faces works just fine

Script here:

import bpy

bpy.ops.object.mode_set(mode='EDIT')

bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.region_to_loop()
bpy.ops.mesh.select_more()
bpy.ops.mesh.select_more()
bpy.ops.mesh.select_more()
bpy.ops.mesh.select_less()
bpy.ops.mesh.select_less()
bpy.ops.mesh.select_less()
bpy.ops.mesh.delete(type='FACE')

bpy.ops.object.mode_set(mode='OBJECT')