Wrapping the whole line would escape everything enclosed, it seems to work OK. I haven't seen reasons for quoting the command & the argument flags like that, it seems unusual to me but it does work 🙂
Double quotes lead to the contents being interpolated or expanded in the shell. You can use single quotes if you want to avoid it & pass a literal value that will 'stay literal'. That would fail if you wrap the whole line in single quotes.
You are right, the disk name could be quoted or you could quote just the spaces too…
sudo bless --folder /Volumes/iMac" "AHT/System/Library/CoreServices/.diagnostics --file /Volumes/iMac" "AHT/System/Library/CoreServices/.diagnostics/diags.efi
It doesn't really matter so long as the right characters are passed, the trouble is knowing which ones to escape or quote, I tend to escape manually when testing then use double quotes in scripts.
Did you get the Mac to boot from AHT?