How do I run blocks stored in a variable?

I've been working on a project, but I've been having trouble running code that I've stored in a variable.
I've tried using 'run [doTask]' and 'launch [doTask]' but nothing seems to work. Any advice?

If you set doTask to some code in one sprite, you have to do
untitled script pic - 2024-03-22T092653.304
in order to run the code for another sprite.

untitled script pic (55)

This worked. Thanks!