But he didn't know when a safe time would be. He had to find that contact lens and get rid of it before the police searched and found it. They could have searched that night and then all would be lost. Sooner just seemed better. I know he's was in a panic isn't a small "but..." it's a very important point. Columbo planted a seed he couldn't ignore even if he expected it may be a trap.
The ending isn't really the "cart before the horse". It's that Peter has a great memory and is prepared to testify against his girlfriend as a witness. I expect he'll have to demonstrate that memory but he should have no trouble. It's not really an episode of logic as many of the best are some Columbo episodes, like this one, are episodes of emotion.