Jalilzadeh would replicate the format of the documents, in the name of three Dunedin doctors, and printed out 31 fake scripts.
He then signed the name of the doctor to make them appear valid.
Some of the prescriptions were made out to the defendant and others were in his wife's name, the court heard.
The forgeries saw Jalilzadeh obtain the drugs codeine, tramadol and diazepam.
On two occasions, he received legitimate scripts from Dunedin Public Hospital but altered them by handwriting "Codeine phosphate" at the bottom.
Over the nine-month period, Jalilzadeh presented a total of 33 forged documents at seven different pharmacies.
According to court documents, his favoured premises was Life Pharmacy, which he hit 13 times.
At times Jalilzadeh would visit the same pharmacy twice in a week to use forged prescriptions in his or his wife's name.
The scam finally came to an end on November 2 when he visited the Urgent Pharmacy and presented a false document for tramadol in his partner's name.
The pharmacist became suspicious and confronted him.
When police later approached Jalilzadeh, he admitted the offending and acknowledged his addiction to codeine.
The defendant was now receiving treatment for it, the court heard.
According to his employer's website Jalilzadeh attained a PhD in mathematics from the University of Otago in 2015.
He is currently a postdoctoral researcher in the wildlife ecology and management team.
The man was remanded on bail pending sentencing.