I found an "if" statement that doesn't seem to be logic-ing properly

tell application "Finder"
	set tdname of TargetDisk to DriveSelection
	set tdformat of TargetDisk to format of disk (tdname of TargetDisk)
end tell

	display dialog "'" & tdformat of TargetDisk & "'" & return & "'Mac OS Extended format'"
	if tdformat of TargetDisk = "Mac OS Extended format" then
		display dialog "Result A"
	else
		display dialog "Result B"
	end if

I am getting result B every time, even when the drive is HFS+ formatted.
Not only that, but here is the result of the debugging dialog that compares the values:

That sure looks the same to me.

I can’t run your script fragment but it looks like one is a constant and the other is a string… ergo Result B.

Yup the format is a constant.
You can convert it to text.

PS your variables seem very wacky:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

set TargetDisk to choose folder with prompt ¬
	"Choose Disk"
tell application "Finder"
	set tdname to name of TargetDisk
	set tdformat to format of disk (tdname)
end tell

set formatText to tdformat as text

log {"tdformat Class", class of tdformat}
-- tdformat Class, constant
log {"formatText Class", class of formatText}
-- formatText Class, text

display dialog "'" & tdformat & "'" & return & "'Mac OS Extended format'"
if formatText = "APFS format" then
	display dialog "Result A"
else
	display dialog "Result B"
end if

No doubt

At this point, I just want something mnemonic and succinct. Typically they get fleshed out as I figure out what I’m trying to do.