String process is complex and power consuming, the best way to do it is store the value into some unused field.
Suppose that you don't use Deform/Animation feature, you can set the patterns DeformOffset.m00 = 30 and 60 respectively and tag all patterns ZU. (DeformOffset.m00 is located at the first line& first column of DeformOffset matrix)
In the script that type:
shape.Offset.z = shape.Offset.z + shape.DeformOffset.m00
Hope it helps.