In the FROM field, tap the crossed arrows icon and you will be able to enter your %SUNSET variable. Now the profile will trigger at the time of %SUNSET.
You say you want this to be a range of time so set the TO value to the range you want. It could be another variable such as %SUNRISE or a time chosen through the selector. To set to midnight, tap on the TO label which will toggle to midnight and a second tap back to an entry field. The profile will exit at the value in the TO field.
You can use the cooldown value set to a time greater than the range of time you've chosen to cause this profile to trigger only once when within the specified range. That setting is accessed by long pressing the profile name until it's highlighted, then tapping the gear icon at the top of the screen.
If you are unable to toggle to the variable entry, you may have to make sure beginner mode is off in preferences (version dependant).
You can get more information on the time context (or any context) in the three-dot menu when in the context.
Or read through the tasker user guide:
https://tasker.joaoapps.com/userguide/en/index.html