I have been looking for doing this with a Toast (or message) myself, and finally came up with a method for having longer Toast messages, and keeping the Toast visible until dismissed by the user. This is what I did:
Create a library called "Toast" with two fields, "Name" (type Text) and "Text" (type Rich Text). Uncheck the "Text" field's "Display the name of the field in the card entry". Then create 4 entries, with Names of "Error", "Warning", "Help", and "Info" (these are the basic "Toast" types, you can add additional ones). You can leave the "Text" field blank.
In the library or libraries that you want to make Toasts, add the following "Shared" script (function):
function Toast(stext, stype) {
stext = stext + "<p><small>Press back to close.</small>";
var v = libByName("Toast").find(stype);
if (v != null) {
if (v.length > 0) {
var p = v[0];
p.set("Text", stext);
p.show();
exit();
}
}
message("Invalid Toast type");
}
Be sure to set the option for this function to allow access of external libraries.
Now when you want to make a toast, simply call the function Toast in your script:
Toast("This was a <b>serious</b> error.<p>You should be ashamed.", "Error");
The user will be instructed to press back to close this toast and return to his current screen.
Note that you can use HTML tags to format the toast.