Bring global pagenow variable into function scope

Otherwise it can't be accessed and a PHP warning is thrown.
Initialize BuddyPress current_group object with mock value

If it isn't initialized, a PHP notice will be thrown
Removing note about checking capabilities in standalone_screen_handler()

edit_course_screen() performs a capability check and dies if it fails, so there's no need to also check capabilities in standalone_screen_handler before edit_course_screen() is called.
Combining vars for single_course and edit_course

They can both use the same ones, so there's no need to maintain separate/overlapping lists
Correcting course_permalink value
Adding mock stub for bp_get_group_permalink()
Moving BuddyPress mock values outside edit block

The default values are needed for the single template too.
Add mock value for BuddyPress current_group slug

Without this, a PHP warning will be thrown when bp_get_group_permalink() is called
Removing early return from is_course() on single Course posts

It was causing edited posts to show their old content until the next page load, because the get_posts() call wasn't running to refresh the post variable.

It was added in a5bfc8997966425da64f190e1b8d39dcb5f5727b to avoid warnings/errors related to undefined values and functions, but earlier commits added mocks for those.