If reinventing the wheel implies no added benefit, the answer is never (or perhaps for educational reasons as someone else has suggested).
If you can identify a benefit, that needs to be weighed against the cost. A benefit may involve maintainability, flexibility, extendibility or any number of ibilities. But that is more like improving the wheel which is OK.