I need to stop function after X seconds

You need to use a BlynkTimer in timeout mode within your sketch. The simplest way to do this is as a Lambda function.

Read the timeout Timers section of this tutorial…

Pete.