No — there's no self-ban command in Roblox, and the "codes" that circulate claiming to do something like that are hoaxes.
They typically instruct you to type a fake command into chat, which does nothing at all. If you genuinely need your account restricted, the route is to contact Roblox support directly and explain what you want done.