In order to put the square "inside" the post, I used one method wich change < " > in adsense code. Is this the only method? Is it Legal
no,the penalty in some countries is 25 slaps with a wet noodle. google says not to change the code,but if it is needed to add the ad to your site and doesn't affect the way the ad is shown,google may not have a problem with it.
Never amend the code provided by Google. I have written a post on how to insert the ad into each post in Blogger. Please read: http://www.dagsensecodes.com/2007/01/wrapping-your-post-with-ads.html On the other hand, if you want to insert the ads into Wordpress blog, you may use certain plugins. E.g. http://wordpress.org/extend/plugins/all-in-one-adsense-and-ypn/#post-2664 Hope it helps.
Adsense Inline: http://www.philhord.com/phord/adsense-inline-with-wordpress-blog-posts/ Top 10 Adsense plugins for wordpress: http://www.quickonlinetips.com/archives/2006/11/10-best-wordpress-plugins-for-google-adsense/