If the user disconnects the chains, they do not cease to operate. In this place, the motives of the developers are more than understandable. Suddenly, the user decides to return "everything as it was"? Perhaps there are some other reasons.
The concept of assigning a label to a specific message is not implemented in the GmailApp class.
For these purposes, you can use Advanced Google services - Gmail
function setLabelToMessage() { // Get label by name 'test' var label = Gmail.Users.Labels.list('me').labels.filter(function (name, l) { return l.name === name; }.bind({}, 'test'))[0]; // Get the first message from the search request var message = Gmail.Users.Messages.list('me', { q: 'subject:Проверка цепей' }).messages[0]; // Set label to message Gmail.Users.Messages.modify({ 'addLabelIds': [label.id] }, 'me', message.id); }