Hello,
ok there are 2 problems.
1) there was a typo in the code as regards the 301 header, which is fixed now. (just download the component again and replace sef.php file or reinstall)
2) if you want both
www.sitename.domain and sitename.domain work, you can simply do it with Apache configuration (using ServerAlias directive) there are no special changes needed to be done in Joomla or JomSEF. Alternativelly you may add an extra RewriteRule to your .htaccess file to redirect all requests from www to site without www or vice versa.
Best regards,
Michal Unzeitig