"No User Interaction Allowed" in Execute an AppleScript

This approach works well for dialogs in “Execute an Applescript” Action:

set frontApp to path to frontmost application as text

tell application frontApp
  --- Enter Your User Prompt Statements Here ---
  display dialog "this is a test"  
end tell -- frontApp

I got this approach from someone/somewhere, but I don’t remember who/where.
If you originated this, please feel free to take credit.