there was a surface map project a while back, not sure if that would be something that was useful or not. but i never really used it much, it seems like it was for larger routers that may have uneven beds, so im sure it could be configured for your use case. maybe the creator of it can chime in. I will ping them on the chat and ask if they can step in and reply.
This lets you probe the surface with a grid and then when compensation is enabled it applies an interpolated Z offset so that it tracks the surface. This way you don't actually have to modify the g-code. (Should make engraving depth more consistent if the bed isn't perfectly level).