OmniFocus automate adding tags to existing tasks

This was a bit more complicated than I thought, but with help from the (evidently famous) Complete and Await Reply script I got it to work:

property todayTag : "Today"
tell application "OmniFocus"
	set theDay to (do shell script "date '+%A'" as string)
	set strTagName to theDay
	tell front document
		set theTodayTagID to id of item 1 of (complete todayTag as tag)
		set theTodayTag to first flattened tag whose id is theTodayTagID
		set lstMatches to complete strTagName as tag
		if length of lstMatches > 0 then
			set recMatch to item 1 of lstMatches
			set strID to id of recMatch
			set oContext to tag id strID
			
			set lstAllTasks to tasks of oContext
			repeat with theTask in lstAllTasks
				set primary tag of theTask to theTodayTag
			end repeat
		else
			display dialog "Context: " & strTagName & " not found."
		end if
	end tell
end tell

I’m enjoying this workflow for planning my week out on Sunday, then running the workflow every day to get a nice to-do list in my Forecast view.