Generally the way to use rosrate is to put it at the end of a "control loop" - code that you execute every iteration. In this way, the "waitfor" will act as a sort of "sponge" - any remaining time left over after you've run all the code you want to run will be absorbed in rosrate. There currently isn't any kind of "while waiting, run this low-priority code, but kill it if it hits the wait limit" functionality.
One thing to note is that rosrate can be treated similiarly to a simple "pause". If you have code that runs on a timer or as part of a callback, this code will continue executing even while the main program is "paused". The same thing can apply to rosrate. So if you want to have some code running in that background that continues while waitfor is waiting, you could work up some kind of callback.