Yes, it does go inside of the custom islands, it just needs to be valid syntax as these are actual php blocks. So just changing what the default for one of the islands look likes an adsense ad might look like this:
$body = <<<EOF
HTML code for adsense ad would go in here.
EOF;