You can obtain the number of divisions on an axis by using
GetCtrlAttribute (panel, control, ATTR_ACTIVE_YAXIS, VAL_LEFT_YAXIS);
GetCtrlAttribute (panel, control, ATTR_ACTUAL_YDIVISIONS, &div);
Next you can set right Y axis with
SetCtrlAttribute (panel, control, ATTR_ACTIVE_YAXIS, VAL_RIGHT_YAXIS);
SetCtrlAttribute (panel, control, ATTR_YDIVISIONS, div);
You will need to accomodate right and left Y axis ranges to obtain a good division value on the right axis. Suppose your left axis has a scale 0 ÷ 100 with 20 divisions and the right axis has a scale 0 ÷ 50, with the same 20 divisions you'll have a quite odd division value of 2.5 units per step on the right axis.