'Toggle' power commands wreak havoc with macros as you have discovered. You need a creative workaround to make it work reliably.
Some players will turn on if you press a key like 'play' or 'open-close' first. If yours will, then program the On macro to include 'play', 'stop'. If it is already on it will start playing and then stop. If it is off, it will turn on, start playing, and then stop.