Found a slight issue with the plugin as is. Originally I only used m.example.com as the domain and everything worked as expected. Today I added forum.example.com to DNS which was also directed to the mobile style (not what I wanted).
This was fixed by changing
Code:
if(preg_match('/'.$styleurl.'/i', $_SERVER['HTTP_HOST'], $match))
to
Code:
if(preg_match('/\b'.$styleurl.'\b/i', $_SERVER['HTTP_HOST'], $match))