That is a lot easier than what I finally came up with. Here is what I did:
declare function pcheck
{
set a to ship:prograde:pitch.
set b to ship:prograde:yaw.
set c to ship:prograde:roll.
lock steering to R(a,b,c).
WAIT UNTIL (ship:facing:pitch >= (round(a) - 5) AND ship:facing:roll >= (round(c) - 5)) AND (ship:facing:pitch <= (round(a) + 5) AND ship:facing:roll round(c) + 5)).
}
I had found out that the pitch and roll, when rounded, stay the same for prograde and retrograde. So I made it wait until they were equal. Then after the function in my code I added a lock steering to ship:prograde, because by then they were close enough that it could throttle without spinning all over the place.