I am not clear if smart signature smart contract can dynamically check local state of txn.sender() and then execute it.
Smart signature and smart contract are 2 different things…
The smart signature is just the escrow account, with the logic so if you do any execution that is not correct it fails…
so in teal something like
gtxn 1 AssetReceiver
bytec_1
assert
will check that the group transaction with index 1 must be asset receiver from specific address that you specify as constant
If all checks are correct you can execute tx from that smart sig account (the address is basically hash of the contract)
Better is to write pyteal, tealscript or whatever more readable:
https://pyteal.readthedocs.io/en/stable/examples.html#atomic-swap
And the best is not to use the smart sig accounts, but deployed smart contracts… Mainly because you cannot from the smart contract execute smart sig, but you can execute another smart contract using app call
Also important thing nowadays is to use ABI compatible language… So that it is much easier to call your smart contract.