Actually this topic is (or should be) about two different subjects:
How to move a block to a different category;
How to change a category's colour.
1. How to move a block to a different category?
There are two ways to move a custom block to a different category:
A. by hand (edit the block, select a category);
B. using code, one block at a time (e.g. , or ).
C. several blocks at a time, e.g. all blocks from a category:
If you use "set [primitive] of block to false", you can then change the color. However the block remains in the same spot in the palette (much like how warp and script variables are gray and of the category "other", but show up in control and variables, respectively).
I reused a block I made earlier. My reason to use id blocks (IIRC) may have been to facilitate moving text content from one slot to another (especially on a tablet, where one selects text with their fingers).
You're right, you don't need to do anything other than just run the block, it automatically makes it a custom block when you change the category (I just tested it out).