Help Re-Popup

What i’m trying to achieve is a Pop up message to appear when a Contact record is opened up and there’s an active ‘Safety Alert’ present within the person’s record. (My last quest relating to this was to color the fields to highlight them just so and now i’m wanting to take it further)

So what I’ve tried so far (unsuccessfully i may add) - just hoping to get a nudge in the right direction.

What I’ve got so far is the directory tree.

SugarPopUp(folder)
manifest.php(file)
-custom(folder)
-include(folder)
-custompop(folder)
custom_popup_js_include.js(file)
customPopUpContacts.js(file)

I’ve got this in my manifest.php

<?php
    $manifest = array(
                array(
                        'acceptable_sugar_versions' => array()
                ),
                array(
                        'acceptable_sugar_flavors' => array()
                ),
                'readme' => 'Please consult the operating manual for detailed installation instructions.',
                'key' => 'customSugarMod1',
                'author' => 'Mark G',
                'description' => 'Adds pop-up Message when a contact has a safety alert.',
                'icon' => '',
                'is_uninstallable' => true,
                'name' => 'Pop-Up Dialog if Safety Alert',
                'published_date' => '2023-01-30 12:00:00',
                'type' => 'module',
                'version' => 'v1.7',
                'remove_tables' => 'prompt'
        );

        $installdefs = array(
                'id' => 'customSugarMod1',
                'copy' => array(
                        array(
                                'from' => '<basepath>/custom/',
                                'to' => 'custom/'
                        )
                ),
                'logic_hooks' => array(
                        array(
                                'module' => 'Contacts',
                                'hook' => 'after_ui_frame',
                                'order' => 1,
                                'description' => 'Creates pop-up message on load if user inactive',
                                'file' => 'custom/include/customPopUps/custom_popup_js_include.php',
                                'class' => 'CustomPopJs',
                                'function' => 'getContactJs'
                        )
                )
        );

And i’ve got this in the include php file

<?php
if (! defined('sugarEntry') || ! sugarEntry) {
    die('Not a valid entry point.');
}
class CustomPopJs {
    function getContactJs($event, $arguments) {
        if ($_REQUEST['action'] != 'EditView') {
            return;
        }
        echo '<script type="text/javascript" src="custom/include/customPopUps/customPopUpContacts.js"></script>';
    }
}

And this is in the javascript that’s called.

document.addEventListener('DOMContentLoaded', function() {
    checkUserStatus();
}, false);


function checkUserStatus()
{
    if($("#safetyalert_c").val() != "YES" )
    {   
        YAHOO.SUGAR.MessageBox.show({msg: 'There is an active safety alert present! ', title: 'Safety Alert!'} );
    }

}

The database field exactly is ‘safetyalert_c’ in contacts_cstm and that’s a field setup as a dropdown ‘YES’ or ‘NO’ value

Am i going down the right train tracks?

Many thanks for your continued support! <3