It's a modular arithmetic trick. Details in an edit in a second.

Basically, the instructions can be reduced to this pseudo-equation:

[(Masturbatex2 + 5)*50 + 1760/1759 - Birthyear] % 100

(where %100 is basically "give me the remainder after dividing by 100," i.e. the last 2 numbers)

Start by foiling the 50 to masturbate and 5 and you get

[Masturbatex100 + 250 + 1760/1759 - Birthyear] % 100

Now, 250 + 1760/1759 is just 2010 (or 2009 if you haven't had your birthday yet this year). 2010/2009 - Birthyear is your age. Thus you end up with:

[Masturbatex100 + Your Age] %100

Because masturbate is multiplied by 100, that part of it will always cancel out. So as long as you are not over 100, you will get the proper answer of Your Age.

EDIT: By the way, step 7 is wrong. If you masturbate more than 10 times a week, you will not get a 3 digit number. And of course the whole thing is inaccurate for people over the age of 99 no matter what.

EDIT2: First edit was partially wrong, step 1 asks how many days per week you masturbate, so it's OK.