Command to cycle between paragraph and task

If I understand correctly you want a o write a command which cycles the line between item/task/heading?

If that’s so, you just need to separate the current line from its prefix and change the prefix. I’ve done something similar a while ago to cycle through the heading levels # → ## → ### …etc

Here is the post for inspiration: