I’m not sure if I understand correctly, but I’m assuming that you want to copy a file from a given path to the Downloads folder, and that the given path is stored in the fileRef variable as alias (see end of your script).
So, to copy it, this should work:
set destDir to path to downloads folder from user domain
tell application "Finder"
duplicate fileRef to destDir replacing no exact copy no
Use replacing yes if you want to overwrite existing files in the Downloads folder without warning.
Is it possible to do the following separately?
encrypt the file/document with a particular password then attach it to Mail as a new message (pushing the url of the file into the Mail as an attachment ready to send the email?)
First and foremost to encrypt documents you need some encryption program. For an asymmetric encryption you likely could use some PGP plugin for Mail, for example from GPG Tools. I think the attachment will be encrypted automatically by the plugin.
For a symmetric encryption you could create an encrypted .dmg (if the recipient is working on a Mac), or, for cross-platform, use the encryption option of 7z , or some other possibilities.
Once you know how you are going to encrypt the document, we can build a macro around it.
 7z is available for macOS as p7zip, a very useful program. (Easily installable via Homebrew.)
Oh, I have no clue of the Daylight app (though I remotly remember some discussion about it, some years ago). The best I can do, is checking your AppleScript for general errors (that are not related to Daylight’s dictionary).
For that you have to upload the complete AppleScript.
Post it as fenced code, or zip and upload it as file.
Or just upload the macro containing the script.
it seems to me when he applescript is triggering and saving a file KM moves onto the next action without allowing the applescript to fully finish. If there was a possibility to tell KM to wait until the AppleScript fully completes that would be great.
What does the code do? I have selected some stuff and based upon my selection it goes in looking for a file with a matching name and downloads that to the Downloads folder.
I cannot seem to find the pause long enough for it to work. It seems to me that the execution of the AppleScript is buggy, because KM moves on without allowing it to save. Is there a code I can place inApplescript where applescript will pause itself until it has fully completed executing the script?