yes, easily if you use level_load(NULL) and ent_create to make the terrain.
if you use level_load("small.hmp") you can call a function afterwards by using the pseudo entity level_ent : terrain_action(level_ent) and declare a function like terrain_action(ENTITY* terrain_ent)