What you should be doing is ANDing the address with those bits. However, to my knowledge, there are no such commands in the vanilla game.
As such, your script will only work under very specific circumstances, (when the weather bits are set to 0x60) and not under all Sunny weather types. (It's possible to only have 0x20 set, or only 0x40 set).
Don't worry, I tested it before posting and have had no problems. I got the code from Solarbeam and just changed the information contained at the pointers. I've used it under Sunny Day, Drought Sunny Day, Plain Weather, Rain, Sandstorm and Hail, on every turn, and so far it works 100%