If blizzard havent changed how shadowmeld works recently, it dosnt matter if the rogue or anyone else can see you, you will still get out of combat, all that matters is if he attacks you before you fly away.
In dungeons, it can be a little harder to SM from mobs, but if you have a little distance to the mobs and you get around a corner use SM instantly, and they cant see you and therefor you drop combat and they wont chase you anymore because the mobs cant see you in a straight line (only 100% working if you are solo or last player alive that is still in combat in dungeons), normally you dont need to get around a corner, but its the best way to be sure.
here is a macro i have used for many years, and it only ‘failed’ me once maybe 2 times, but only because of getting unlucky with an attack hitting me just as i used SM
#showtooltip Shadowmeld
/tar player
/cancelaura starfall
/cast [combat] Shadowmeld
/targetenemyplayer
/stopmacro [combat]
/cast [nocombat] !Travel Form
You dont really need to cancelaura starfall if you dont use it and you dont need to targetenemyplayer, i just like it to do that.
With this macro you can keep hitting it until you are in flightform or it failed if really bad luck, but you must know when you are in Flight form known as travel form, because if you hit that macro after the standard CD of being able to ‘dismount’ around 1 second after flying, you will cancel flightform
so just be aware when you are in flightform and then fly and stop hitting the macro anymore
its been fantastic for me over the years, had to edit the macro when they changed flightform to travelform
Test the macro in a duel with a friend and see if he can stop you from flying
The beauty of the macro is that you will fly instantly with SM getting you out of combat, if you use shadowmeld without the macro and have to check that you are in shadow meld (out of combat) before hitting fly, you risk getting in combat before flying…