Ok you have a set of variables:
var height1 = 10
var height2 = 20
...
var height7 = 70;
The user has given input and you need to get the v
Assign the height's as properties of an object.
Something like..
var heightObj = {
height1 : 10,
height2 : 20,
height7 : 70
};
var hash_div_height_id = "height" + option_name.substring(6);
To access the particular property , use the [] notation to access the property
var newHeight = heightObj[hash_div_height_id];
$('a[name=' + hash + ']').closest('[id^="option"]').height(newHeight);