I finally got the syntax right but tasker doesn't appear to have AlertDialog.Builder implemented.
Sorry, was going to respond yesterday but wanted to try to answer your original question first.
The answer is unfortunately that you can't because a dialog needs an activity context to show over,
whereas the CONTEXT you get from Tasker is an application context (based on a service).
01-08 13:13:04.520 W/Tasker (2100): 13.13.04#E: warning: Java Function: java.lang.reflect.InvocationTargetException