Disable script on condition

Good day, from this page I run the below script, which extracts, in the field “Name”, the publisher from the bibliographic item (Feltrinelli, in the example). I would like the script to run only once, that is to be disabled when on the previous page there is the expression “Modern publisher” under the heading “Persons, institutions and families”.

function getNome(tmp) {
 
    idx = tmp.indexOf('. ((');
 
    if(idx > -1){
    tmp = tmp.substr(0, idx);
    }
 
    tmp = tmp.split('. - ');
     
    switch(tmp.length){
    case 3:
    tmp = tmp[1];
    break;
    case 4:
    tmp = tmp[2];
    break;
    default:
    tmp = "";
    break;
    }
     
    if(tmp !== ''){
        tmp = tmp.substr(tmp.indexOf(' : ') + 2);
        console.log(tmp);
        if(tmp.indexOf('.') != -1 && tmp.split('.').length == 2){
            tmp = tmp.substr(tmp.indexOf('. ') + 1, tmp.indexOf(', ') -3);
            tmp = tmp.trim();
        }
        else {
            tmp = tmp.split(",")[0];
            tmp = tmp.trim();
        }
    }
    return tmp;
}
function impostaNome(tmp) {
    Array.from(document.querySelectorAll('article section.grid_container form div.grid-row label span')).filter( e => e.innerText.trim() === 'Nome')[0].parentNode.querySelector('input').value = tmp;
}
impostaNome(getNome(document.querySelector('div.meta.tito div.evidence.isbd').innerText));