What is the use ようとは　+ passive?


おそまつな警備だな これで俺を捕まえようとは舐められたもんだ

My vague understanding of the sentence is akin to "Ill prepared defenses. If
they are attempting to catch me with that, they are looking down on me."

However grammar wise, I'm not really sure how ようとは is interacting with he
passive here? "Attempting to look down on me by attempting to catch me with
that?" Why とは?

Is this an if form or an "attempt to do x"?




Your understanding is perfectly fine.

The とは is the same as the following

  * [Help with お逃げになられるとは](https://japanese.stackexchange.com/q/24976/45489)
  * [Questions about 「とは」and 「思わなんだ」](https://japanese.stackexchange.com/q/29388/45489)
  * [まだいたとはね meaning](https://japanese.stackexchange.com/q/30285/45489)

よう is the ordinary auxiliary verb meaning _to try to.._.

The passive is not exactly interacting with the preceding part, it is natural
rather because the following もんだ expresses perception on the speaker's side
(cf.
[もんだ#1](https://dictionary.goo.ne.jp/thsrs/17282/meaning/m1u/%E3%82%82%E3%81%AE%E3%81%A0/)).
It is not impossible to use active voice like ・・・とは舐めたもんだ.

* * *

Very literally, you can think, given that とは= quotative + topic, _That they
are trying to catch me with this means that I'm looked down upon_.

