Is there a way to toggle a secure lock screen without having the feature built into a custom ROM? Benzo Rom for the Nexus 6 running 5.1.1 Lollipop allows the ability to toggle a secure lock screen from the quick settings in the notification drawer. For example, from the launcher, I can pull down the notification drawer to access the quick settings panel and tap the lock screen option and it will automatically engage the lock screen even if there was a password/pattern/gesture/pin, etc. previously setup. If I tap it again, it will remove the secure lock screen.

My concern is that this feature was built into the custom ROM itself and I don't know an alternate solution to this. Is there any solution to achieve this?

Edit #1

I was hoping for a solution that was not related to Tasker or Secure Settings. Something that's more clean and integrated.
I'm not too familar with doing stuff like this, but I guess this will help!
Well, I'm pretty sure the app called Tasker is able to do it if the Android version is between 4.x.x and 6.x.x, not sure if Automate can do it?
I do personally recommend Tasker if you want an app that is able to do a lot on your phone, even without ROOT it can do amazing stuff. Else I would recommend to give Automate a try, I'm not that familar with it and can't tell that much about it.
Tasker

Cost's 3 USD!
Create and sell your own apps!
I don't know what it can't do! I'm not kidding!

Automate

It's free to download and ad-free!
Easy-to-use drag-n-drop design!
Built-in community to download other user's uploaded automation tasks!

Both

Automating what ever you want, just like you want!
Use ROOT functions like executing shell commands or rebooting you phone!

Sorry for my bad english if it's not good enough! At least, I tried my best!
EDIT: I'm not able to tell you that any app can help you with a Nexus 6 because I do only have a Galaxy S7 Edge that is working and a Galaxy S5 without a working display.