grymjack For those that are interested, here is the function. I also added an extra parameter that will allow you to pass in a Vector2 to control the dialog size.
func alert(text: String, title: String='Message',dialog_size=Vector2(200, 100)) -> void:
# credit for original code to: https://gamedev.stackexchange.com/users/135571/hola
# https://gamedev.stackexchange.com/questions/177723/simple-message-box-in-gdscript-godot?newreg=265dab057bb6497a98f510e6efa3ae85
var dialog = AcceptDialog.new()
dialog.dialog_text = text
dialog.title = title
dialog.connect('modal_closed', Callable(dialog, 'queue_free'))
dialog.size = dialog_size
dialog.get_child(1, true).horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
add_child(dialog)
dialog.popup_centered()