Try this Lua script
Code:
retval, num_markers, num_regions = reaper.CountProjectMarkers( 0 )
reaper.GoToRegion( 0, num_regions, false )
time = reaper.GetCursorPosition()
markeridxOut, regionidx = reaper.GetLastMarkerAndCurRegion(0, time)
retval, isrgnOut, posOut, rgnendOut, nameOut, markrgnindexnumberOut, colorOut = reaper.EnumProjectMarkers3(0, regionidx)
start_time, end_time = reaper.GetSet_LoopTimeRange(true, true, posOut, rgnendOut, 0)