Adding the code in blue seems to work in very limited testing, but I'm not clear if this would be against the TOS.
I wish there were a way to wrap the whole <script> ad code </script> in a container javascript if statement instead of having to insert the if statement so that if a scanner checked it, it would see that it's 100% unchanged. But I don't think there's a way to do that. If someone has done it, would be very interested.
<!DOCTYPE html>
<html>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
(jquery already loaded by xenforo -- only for test here)
<script type="text/javascript" language="javascript" src="//c.amazon-adsystem.com/aax2/getads.js"></script>
<script type="text/javascript" language="javascript">
if ( $(window).width() > 740 ) {
//<![CDATA[
aax_getad_mpb({
"slot_uuid":"1234567890"
});
//]]>
}
</script>
</body>
</html>
(or an else { } statement could be added, so desktop would have desktop ad
slot_uuid and mobile size screen would have mobile slot_uuid.)