How to turn on modal window auto-appearing when program needs your attention
Modal dialogs aren't something you can guarantee will show. The OS allows users to use multiple displays, multiple virtual desktops, pin apps to all displays, no displays or a specific display.

Notification center is the correct tool to send a notice to a user so I would redesign your script/tool/app to make use of notification center.

Also, without seeing some bare stub of what you have already, it's really hard to suggest you how to implement a change. Just as on Stack Overflow - if you have a problem with a tool or a script here, please show your work and ask a follow on question to explain exactly what you desire to happen and what you have so far.

Here's a tiny python script you could try: a little python "script" I've adapted from a brief search of SO:

import Foundation
import objc
import AppKit
import sys

note = objc.lookUpClass('NSUserNotification')
center = objc.lookUpClass('NSUserNotificationCenter')

def notify(title, subtitle, info_text, delay=0, sound=False, userInfo={}):
    notification = note.alloc().init()
    notification.setTitle_(title)
    notification.setSubtitle_(subtitle)
    notification.setInformativeText_(info_text)
    notification.setUserInfo_(userInfo)
    if sound:
        notification.setSoundName_("NSUserNotificationDefaultSoundName")
    notification.setDeliveryDate_(Foundation.NSDate.dateWithTimeInterval_sinceDate_(delay, Foundation.NSDate.date()))
    center.defaultUserNotificationCenter().scheduleNotification_(notification)


notify("AskDifferent", "you can program now", "Here we go... ", sound=True)
sys.stdout.write("Notification sent...\n")


It works on El Capitan without needing any extra files or downloads afaik. Again, there are dozens of options and languages, so it's more about what you want to do long term and if you're comfortable with modifying scripts.