Hold down a hotkey and Maya's timeline will contract around the current frame, looping the shorter range, and restoring everything when the key is released.

1. Download RangePlay.zip and extract it to:

C:\Users\YOURNAME\Documents\Maya\Scripts

2. Create a new hotkey, set it to "On Press" and assign the following Python code (Maya 2022 and later):

import importlib
import RangePlay
importlib.reload(RangePlay)
RangePlay.HotkeyPressed()

Or use this code for earlier versions of Maya:

import RangePlay
reload(RangePlay)
RangePlay.HotkeyPressed()

3. Create a second hotkey using the same key, but this time set it to "On Release" (Maya 2022 and later):

import importlib
import RangePlay
importlib.reload(RangePlay)
RangePlay.HotkeyReleased()

Or use this code for earlier versions of Maya:

import RangePlay
reload(RangePlay)
RangePlay.HotkeyReleased()

4. Create a new shelf button (for a tool options UI) with the following code (Maya 2022 and later):

import importlib
import RangePlay
importlib.reload(RangePlay)
RangePlay.CreateUI()

Or use this code for earlier versions of Maya:

import RangePlay
reload(RangePlay)
RangePlay.CreateUI()