How can I limit data usage depending on whether the screen is on, or off/locked?
Use Tasker app which can disable the internet connection automatically when the screen is off. Configure the app as below:

Profile: Screen Off

Context: (Event) Screen off

Task:

Clear variable %SCREENSTATE
Stop if %POWER ~ ON
Disable "Mobile Data" (With "Keep MMS" if you want)
Disable "Auto-SYNC"


Set Profile's Task Priority to 6