Hi Jean,
How about a separate grob with engraver? Try the attached.
This should be included in the documentation as a textbook example for a not-quite-trivial, but reasonably straightforward example of a both a custom engraver and a custom grob. Thanks very much for this!
And wouldn't it be worth to add the convenience macro define-grob! to LilyPond's stock scheme library?
Lukas