I think the answer is in c2's runtime with it's capture action. It doesn't grab the canvas right there, instead it grabs it later (I think it's right after the next redraw).
I was fiddling with that with the paster plugin before and you have some places in the plugin that's run at different times.
Two that come to mind are the tick() and tick2() functions. I forget if there are others. One is run before the event sheet and one is done after. You do have to tell the runtime to call those functions with I think a tickme() call? Searching for tick2 probably would give a post with more info as I recall, as well as any I'm fogetting here. Anyways my guess is in those places might be better times to grab the canvas, but it's kind of test and see.
Basically the process would be to set a Boolean with your action and in the tick function it would check if the Boolean is set and then do what your action does currently.
The idea can probably be more definite, you just need to break down what the runtime is doing. Off hand I think it looks something like this? I'd have to verify where the capture is done.
Tick()
Events
Tick2()
Capture canvas
Draw
Repeat