You're correct. There are two lines in the script that need to be updated:
kRecordName = '1''contour';
kFieldName = 'CONTOUR';
For example, if in your file the record is named record1 and the record field with the elevation data is named, ELEVATION then the lines should look like this:
kRecordName = 'record1';
kFieldName = 'ELEVATION';
Also, as Jonathan mentioned if you have Vectorworks 2014 or newer, you can use the Modify by Record command to perform this action. Using the Elevate 2D Polys option, you can convert the polygons to 3D polygons and choose the record and field used to set the elevation. You can also apply a multiplier to the field if you need to adjust for unit values.