This handy template has template parameters (Query, Specifiy Values for Template Parameters) - use that instead of search and replace.
The template has two merge statements with descriptive comments in brackets.
The Type 6 SCD uses 2 merges:
Type 1 (changes on non-historical fields, deleted source records)
Type 2 (changes on historical fields and new records)
This will make it easier to create the processes as they are here as shells and you won't need to remember the syntax.
Many thanks to Adam Aspin's wonderful article for teaching me about the OUTPUT portion of a MERGE.