If I remember correctly, [iemguts/receivecanvas] sends a message when you change the edit mode. Not sure that you'll find a way of doing it in Vanilla though.

From: Pd-list <pd-list-bounces@lists.iem.at> on behalf of Alexandre Torres Porres <porres@gmail.com>
Sent: 24 February 2019 17:20
To: Pd-List
Subject: Re: [PD] Query if Pd is in Edit mode for a GUI
 
Em dom, 24 de fev de 2019 ās 13:27, Alexandre Torres Porres <porres@gmail.com> escreveu:
 But if it's impossible, I'm fine with that.

Coming to think of it, Pd actually changes the appearance of its comments when in Edit mode, where it shows where to change the size of comments. So yeah, it's totally possible. But I still hope you can help me out with the golden hint of which built function to use from pd's source, cause I've been browsing the code for about an hour and couldn't find it :/