In that case I think I would save the action as a string in your save/txt file and when creating the entity on save load / map load use engine_getscript (char* name ) + the saved string in your ent_create function.

OR use game_save/game_load and only to save the functions/level/ents. Could be buggy though.