As long as both you and your ex are cool with it, I don't see the problem. If you still want to hang out with him but not want him to make any moves, you should just treat him as a friend and be careful about what you say and do. Make sure that your actions are not suggestive in any way. But if your ex makes a move, you have a right to say no and tell him to back off. After that, you probably shouldn't hang out with him (at least alone) anymore.
Is it a good idea to see your ex when you are dating someone else? I mean as friends, nothing more... What do you do if your ex makes a move on you?
To be honest, I started hanging with my ex again when I was with someone. It brought back all the feelings of each other. Just make sure its ok with the person your with at the moment
You need to think about the relationship that you're in now. If your current BF is OK with it, then that's cool. But most guys would not be cool with that. When I was dating my wife she was still seeing a past BF, but she wasn't honest about the nature of their past relationship. She'd lead me to believe they were "just friends" but there was more to the story. I felt betrayed and it almost ended the relationship. And it pops up as a trust issue even 15 years later. What reason do you have for hanging out with a past BF? And even if your intentions are noble and honest, we guys know his probably are not.