As your Jacobian matrix approaches a singularity, one or more of your joints will be required to reach an excessive velocity in order for the end effector to remain on the path. This is a problem when you want the end effector to continue with a non-zero speed along its path. Otherwise, the singularity could cause the end effector to dwell while the nullspace motion of the robot eventually resulted in it being able to continue along the path, and you wouldn't have to implement any optimal control algorithms.
When the configuration becomes close enough to a singularity, any control approach will either cause the end effector to reduce below the desire speed, or else will cause the end effector to deviate from its desired path. If you think of the desired trajectory as a set of differential motions (or speeds), you can see that the two problems above are really the same thing: the end effector is unable to continue with nonzero speed along a desired path.
Systems have been controlled which attempt to optimize the motion in the neighborhood of singularities. Often they will use a gradient technique to minimize the error from the desired trajectory (the path/speed combination). The interior point method is one of these approaches.
You would need to set up your objective function (or constraint) to be optimized to be related to the error between the desired trajectory and the achievable trajectory. I have seen pretty simple optimization functions such as minimize the sum of the square of the joint velocities, all the way through very complex optimizations that trade off between speed and positional deviations.
I think the answers to this question will help you get started: With a 6-axis robot, given end-effector position and range of orientations, how to find optimal joint values