N64 uses the C programming language, so the code can be put in one of the files for it to work.
a less easy solution is to just try to put it in every file until it works
but yeah that's not the best plan.
I found a decomp file of mario 64 online with a file named behaviour that had the same type of codes like this one maybe you can try to but in in the file named ''behaviour_data.s''
maybe I'll put the launch star in my hack too if this works. I always loved super mario galaxy.
if it doesn't work then we'll try something else
edit: make sure you paste it in right because I'm almost sue this is where the code has to be