If you don’t care about whether the light is on or off, you can save the trouble (and delay) of polling the status before sending the command by using a virtual momentary switch.
-
Create the momentary switch using @TAustin 's virtual device creator.
-
Create a routine so that when your virtual momentary switch turns on, your (real) light toggles.
-
Always send an “on” command via tasker to turn on the virtual device, which will toggle your light.
Hope that helps!