Having the same issue here. The error message is:
/tmp/test.osa:0:71: execution error: No user interaction allowed. (-1713)
If I change David's script like this, it works:
tell application "System Events" activate display dialog "This is a sample Applescript dialog called from Alfred" end tell