Iterate through all visible areas and override the context when calling area_split()
operator.
Blender 3.2+
import bpy
from bpy import context
for area in context.screen.areas:
if area.type == 'IMAGE_EDITOR': # 'VIEW_3D', 'CONSOLE', 'INFO' etc.
with context.temp_override(area=area):
bpy.ops.screen.area_split(direction='VERTICAL', factor=0.3)
break
Blender 2.8+
import bpy
for area in bpy.context.screen.areas:
if area.type == 'IMAGE_EDITOR': # 'VIEW_3D', 'CONSOLE', 'INFO' etc.
override = bpy.context.copy()
override['area'] = area
bpy.ops.screen.area_split(override, direction='VERTICAL', factor=0.3)
break