My script is very experimental, so be careful when using it.
It should be very easy to do that. There are "custom events" (non built-in events) in the scripts for these purposes; these are functions that begin with "on_". Some of them are not defined, but some of them will be called if they are defined.
I don't recommend to modify the base script. It is better to mimic the "inheritance of objects" in Lua, somehow, and overriding/defining those "custom events" for particular subtypes of custom portable entities. I don't have time to help you with the details, though.
As an example, note that the phoenix chicken that appeared in one of my videos uses these "custom" scripted events for the customization of the falling speed, max distance reached, the behavior after falling to the ground, etc. Some "custom" events are just overriden in this case.
(Note that Christopho will probably add optional portable features to all (or some types of) entities, so my script will be unnecessary someday. But this will not happen until Solarus v1.6 is released, which will happen in one year or maybe more time.)