Is there another way that requires fewer lines of script? A condensed version maybe. It's done so I guess it doesn't matter but just wondering for future reference.
I would try something like this:
_a = A - INT(A/12") * 12"
if _a > 11.992" and _a < 12" then
plan_fill = 21
parameters plan_fill = plan_fill
Team Leader, Library Team