Be careful when editing htaccess instead of the plugin index file because the next time you change some settings in the plugin, it will overwrite any manual changes to the htaccess file. Adding the above to the imaguard/index.php should make sure it works all the time.
We will look into improving this for the next update anyway, to take into account this sort of redirect that you have in your domain root folder.
PS! You may also have to change this line
$ir_location = get_bloginfo('url')."/index.php?p=".ir_getpostidbyurl($_GET['img']);
to
$ir_location = get_bloginfo('wpurl')."/index.php?p=".ir_getpostidbyurl($_GET['img']);
if you want to use the redirect to blog instead of watermark. That should compensate for the issue with your domain root redirect.
As for your question re the htaccess, just off the top of my head, something like this should work in a htaccess file in your domain root:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com$
RewriteRule (.*) https://www.yoursite.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(.+)\www.yoursite\.com$
RewriteRule ^/(.*)$ /blog/%1/$1 [L]
Make sure to backup your old htaccess file. Don’t kill me if it doesn’t work – I haven’t tested it.