Python - Baking vertices position for a frame range
Ok, unfortunately @Jerryno solution didn't work so I ended up trying something else.
I successfully made it wok by triggering the animation with bpy.ops.screen.animation_play() in the __init__ function, then doing my action in the modal function and finally stop the animation when 'ESC' is entered or the action is finished (in the __del__ function).

The handler is added in an invoke function running modal.