Display dialog in Applescript runs badly

When running Display Dialog in Applescript the display dialog seems stuck and unresponsive. After a few keyboard entries and hard press on touchpad then the dialog window responds, but it take another hard click to accept my response (I have my laptop on tap click so there really isn't any need for a hard click). Please see the simple Applescript below. Please note that I ran this using Script Editor and Alfred and I don't experience any of these issues. I even tried to have Alfred run the script (using a trigger sent to Alfred) and continue with another keystroke commands later to paste the keyboard content to an app. However when I did this the BetterTouchTool list of commands had already executed before I even entered the input. Of course I would rather run this all in BetterTouchTool, but I can't unless the display dialog is fixed (or I figure out what is causing the issue). Please try this script and tell me if you have the same issue.

tell application "Safari"
set theURL to URL of front document
set theTitle to name of front document
display dialog "Name of link?" default answer ""
set theName to text returned of result
set the clipboard to "[" & theName & "](" & theURL & ") @URL " as string
end tell

**Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.): Macbook, Applescript triggered by Touchbar button

Device information:

  • Type of Mac: Macbook Pro 2018
  • macOS version: 10.15.2
  • BetterTouchTool version: 3.215 (1392)