Here's a dodgy example: http://dl.dropbox.com/u/6660860/sine.cap
I say it's dodgy because you will notice that if the sine behavior takes the sprite away from the mouse, it stops (there would be ways around this). If you don't want it to stop when the mouse isn't over the sprite, just remove the Else condition.