I think you played it fine. Not sure how he ever shows up with a nine here although to be fair if he is a thinking player you don't that often either. I do this a great deal on four to flush boards and you really do get them to fold often enough to make these kind of plays profitable especially at these levels.
Levelling wars innit,