Prevent iOS device from sleeping if plugged to charger
In the past there was an Cydia App called ScreenDimmer.

I hope you can find this application via your iPhone and fix your problem.

One of its features: 


  
  Doesn't dim the screen if the battery is being charged.