Other aircraft doesn't apply right of way rules
See and avoid is the backbone of VFR flight. The right thing to do when there is a potential collision is to take positive action, which is exactly what you did. There's no one-size-fits-all solution as to whether to turn one way or the other, climb or descend - it all depends on the position and course of the aircraft in question. 

Often which way to turn in these situations is the lesser of two evils, if you turn left you clear sooner but if the other airplane turns right there's a potential conflict, if you turn right then you are in potential conflict longer. You have to choose one and hope the other person takes the right action. 

One way to avoid conflict is a change of altitude, if you are slightly higher than the other airplane then climbing quickly takes you out of conflict, if you are lower then a descent does the same thing. If you are the same altitude then I favor descending as most people's default reaction is to climb - if the other pilot sees you they're more likely to pull up, giving you better separation. Even if you are under ATC direction changing altitude is the right action as it's necessary for the safety of the flight. You change altitude, avoid the collision, then go back to your assigned altitude before radioing ATC and explaining the deviation. I doubt they'd have a problem with that and even if they did regulations are on your side.