Im creating a haunted hotel and need help with converting command blocks to code

I am converting from command blocks to a datapack and am wondering if anyone can help me figure out some of the conversion.

Continue to help post