I'm sorry to hear of your dilemma.
I'm confused as to how it is that the doctor gave you a prescription, and then claimed that he had not given you one. Did the doctor perhaps claim that only part of the prescription was forged?
The forging of narcotic prescriptions is a very serious matter and can, in many cases, be charged as a felony.
If you have already given the police your handwriting exemplar, the next step from them will either be, 1. you'll hear nothing more from them, or, 2. they may seek an arrest warrant against you, or an indictment, and you will be picked up and taken to jail.
Under these very strange circumstances, I would suggest that you immediately contact a criminal
defense attorney. Something just doesn't add up and your freedom is at risk.
I wish you the best.