for me its not straight forward to convert it for the engine module, i replaced (i hope its correct)
createentity() with create_entity()
set_keyvalue() with DispatchKeyValue()
mdll_touch() with fake_touch()
but i dont know what to do with
mdll_spawn(entity)
and
set_pev(entity,pev_classname,make_string(szCl assname))
(maybe entity_set_string() )