Aha! Solved it!
There wasn't a problem with the script. The room originally had a background but when I just covered it with wall tiles, I couldn't see which one it was.
When I was done doing a poor job of testing, I deleted all the unnecesary backgrounds. It sounded like it was a problem with...