The rc.local file on Debian is mostly for compatibility with non-init style systems. You should not use it.
Instead, it is recommended that you copy /etc/init.d/Skeleton/etc/init.d/Skeleton to a new init script for whatever you want to happen while changing runlevels, then use inserv to enable it.
Update: As per the comment below, this answer is no longer recommended. However, this answer was posted several years before skeleton deprecation, and that skeleton still exists in Debian unstable as of January 2019.