How to automate deleting what's inside the search box in the Dictionary app after 3/5 seconds?
This works for me using the latest version of macOS High Sierra.

Save this following code in script editor as an application.  This application will continue to run until you quit the Dictionary.app

Adjust the delay values to suit your needs.

tell application "Dictionary" to activate
delay 1
repeat until application "Dictionary" is not running
    tell application "System Events"
        tell process "Dictionary"
            tell its window 1
                repeat
                    delay 1
                    try
                        if value of text field 1 of group 3 of toolbar 1 is not "" then
                            delay 5
                            try
                                set value of text field 1 of group 3 of toolbar 1 to ""
                            end try
                        end if
                    end try
                    exit repeat -- when you want to exit the loop
                end repeat
            end tell
        end tell
    end tell
end repeat


Be sure to add this new created application to your list of apps allowed to control your computer.