The best way to do this is to talk to your players and maybe even other DMs. If they've been playing longer than you've been DMing, then listen to them. You might need to place certain restrictions on when the weapon can be used or lower its abilities. Generally, if you are looking out for an overpowered item there's a good chance it won't be overpowered… but still, keep it in mind. A little conversation goes a long way when it comes to homebrewed items, so make sure to talk it out. Your players might even have some input of their own when it comes to adding magical items into the world. Finally, if you are really concerned with power levels, then you should find a similar item from D&D or another game and simply reskin it. Change a few numbers and names around and add some abilities and you'll be fine. It will fit into the game without fail.