To plan for a target, work backwards from the formula. Multiply the target GPA by your total credits to get the points you need, then see which grades get you there. For 13 credits and a target of 4.0, you need 52 weighted points. The worked example gives 50.2, so 1.8 more points would do it.
One grade change can close that gap. Raising the B in Honors to an A adds (4.0 + 0.5 - 3.5) x 3 = 3 points, taking the total to 53.2 and the GPA to 4.09. Raising the B+ in the regular course to an A- adds (3.7 - 3.3) x 3 = 1.2 points, taking the total to 51.4 and the GPA to 3.95, just short.
Advanced courses move the number faster, because the bonus multiplies with the credits. A one letter improvement in an AP course is worth more than the same improvement in a regular course, which is the whole point of weighting. Focus your effort where the points are biggest, and check the result here before the term ends.