The simplest way to perform dictation is to open a dictation grammar and activate it. Whenever a PhraseFinish notification is received, insert the text returned by PhraseFinish at the insertion point in the user's document, as if the user had typed the text.
The application should monitor the text for voice commands such as "Stop dictating" and other editing commands so it doesn't transcribe these into the user's document. Be aware that the words in "Stop dictating" may come in two different phrases, each with its own word.
The set of commands available within dictation is up to the application, but the number of commands should be kept to a minimum because any command that the application is listening for cannot be dictated. For example, if "Stop dictating" is a command, the user cannot dictate those words in a sentence such as "Please stop dictating my life."