I don't know why it wouldn't, except maybe for the PAUSEs.
The last code posted would take over 42 minutes to dim from 1023 to 0 with the included pauses.

Can you post your code again the way it is now?