setFlag works perectly fine for me for custom-numbered flags, at least for the handful (below 1024) I've tried using. I have a line in one of my scripts: setFlag(390, x), where 390 is the flag I'm using, and x is a variable for a couple lines earlier. Perhaps you're using flags above 1024, and Aquaria doesn't assign more space than that to its internal array of flags?
Anyway, I haven't tried this yet, but it sounds like a nice addition to the game. Suggestion: Use a flag or something to record a general time of day (morning, afternoon, evening, night, etc.), so that other scripts can use the current time of day to determine things like how entities act, or possibly even what songs do.
- Edwards