The whole of this storyline is simplistic and unrealistic, for dramatic purposes. (Thge target audience is teenagers etc.). e.g. the process of waking up from a coma after several weeks of unconsciousness is slow and painful, not instantaneous. If it were real, then:
Cameron in hospital would have had tubes and bleepy things to feed and monitor him
He would be regularly turned and given exercise and physiotherapy
Cameron would probably have lost a lot of weight compared with Robert
The staff in the hospital would therefore have noticed the swap.
When Cameron woke up, he would not have had the strength to overpower Robert and escape.
If you want to know how it all works out in future episodes, go to www.ramsay-street.co.uk/episodes and start at the 4976 to 5000 section. Some of the details are sketchy, but it is a good website.
by the way 4getmenot: Cameron and Robert are not twins - they and Elle are triplets.
In answer to the original question:
1. Cameron (good) was in a coma as a result of an "accident" which was arranged by Robert;
2. Robert (bad) was in Erinsborough pretending to be Cameron;
3. R. committed crimes to get revenge on Paul for being a bad father;
4. R. framed C. by planting fingerprints on the tools;
5. C. woke up and realised what R. was doing;
6. C. overpowered R. and escaped;
7. R. got into C's bed and is pretending to be in a coma.
The point where C. escaped and swapped places with R. coincided with the time when the others realised that R. (pretending to be C.) was evil and horrid. Therefore C. is now in prison charged with crimes which were committed by R. while R. was pretending to be C.