Please check with : if (Sitecore.Context.PageMode.IsPageEditorEditing)
also is working on Sitecore 6.6, it not depends on Sitecore 7.
Please check also this Sitecore blog post by Martina Welander.
To check if is normal page use: if (Sitecore.Context.PageMode.IsNormal)
To check if is preview mode use: if (Sitecore.Context.PageMode.IsPreview)
Also are others PageMode:
- IsPageEditorClassic
- IsPageEditorDesigning
- IsPageEditorEditing
- IsPageEditorNavigating, etc
If you are curious you can check with Reflector or dotPeek this class: Sitecore.Context.PageMode from Sitecore.Kernel assembly.