If you are not publishing to the web, you can open a new window to a layout displaying this message and then your script can close the window. This can create issues if you are using Windows OS and have your windows "maximized", but it can be done with careful scripting.
You may find it easier to add layout text that says "Congratulations" in large bold type to your layout. You can then use a conditional format to hide/reveal the text and your script can change the value in a field or variable to control the conditional format.
You can set the font size of your layout text to 500 in the conditional format to make it disappear.