I'm not sure why the first code box doesn't work as it looks like it should. But, you can try this which combines the two:
HTML Code:
<if condition="!in_array($forumid, array(472,417,474,475,473,476)) AND (THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member]))">
adsense code here
</if>
You may want to try $threadinfo['forumid'] instead of $forumid if it still isn't working.