Delete only outer vertices from faces in a faces-and-edges-selection selection
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')