The dialog scripts and the other scripts are a separate "format" sort of. The dialog scripts have special APIs available to them that makes it easier to construct the dialog objects.
Usually, you would have a foo.dlg.groovy file in mods/dialog and then in your regular event script you'd call:
dialogs.startDialog( player, "foo" );
Note: I haven't tested that starting a dialog during player join will actually work but in theory it should.
Other than that, your dialog definition looks ok... if it were in a dlg.groovy file.
Here is a reduced version of the help dialog for reference:
// Predefines an option that can be easily referred to with an option()
defOption( id:"map", text:"How do I see the map?" ) {
showPrompt( """\
The in game overland map can be accessed using one of the
following methods:<br>
- press TAB and click 'Map'<br>
- press 'm'
"""
) {
option( text:"Done" );
}
}
// Initiates the main prompt for this dialog file
showPrompt( """\
Welcome to Mythruna's in game help.
Please select a help option from below.
"""
) {
option( "map" )
option( text:"Never mind" )
}
Hope that helps.