Taken from the idea of SetAccess written by TBN for Stealth 2.6; although I used all my own code.

Tested and working.
If you have ideas of anything to add in, let me know.

This is written in script format, and must be added to your scripts folder in Stealthbot.
CODE
'// This script allows access/flags for internal bot commands to be set from chat

'// Commands:
'//   setaccess  (change command access/flag reqs) Aliases: setrank, setflag, setflags
'//   delaccess  (disable a command completely)  Aliases: delaccess, remaccess, disablecmd


Private Const cmdAccess = "200"     '// (Access, Flag, or Username) required to use commands
Private Const Highest   = 200        '// Integer - Highest access level a user can set commands to
Private Const Lowest    = -1        '// Integer - Lowest access level a user can set commands to


Script("Name") = "SetAccess"
Script("Author") = "AwaKening"
Script("Major") = 1
Script("Minor") = 0
Script("Revision") = 0

Sub Event_Load()
End Sub

Sub Event_Usertalk(Username, Flags, Message, Ping)
    ParseText Username, Message, 1
End Sub

Sub Event_WhisperFromUser(Username, Flags, Message, Ping)
    ParseText Username, Message, 3
End Sub

Sub Event_PressedEnter(Text)
    If Left(Text,1) = "/" Then
        ParseText BotVars.Username, BotVars.Trigger & Mid(Text,2), 4
    End If
End Sub

Private Sub ParseText(Username, Text, Origin)
    If NOT Left(Text,Len(BotVars.Trigger))=BotVars.Trigger Then Exit Sub
    If Len(Text) < 2 Then Exit Sub

    Dim cmd
    cmd = Split(Mid(Text,Len(BotVars.Trigger)+1))
    
    Select Case LCase(cmd(0))
    Case "setaccess", "setrank", "setflag", "setflags"
        If NOT userHasAccess(Username, cmdAccess) Then Exit Sub
        If UBound(cmd) > 1 Then
            Dsp Origin, ChangeAccess(cmd, True), Username, vbCyan
        Else
            Dsp Origin, "Proper usage: " &BotVars.Trigger&cmd(0)& " <command> <access/flag>", Username, vbOrange
        End If
    Case "remaccess", "delaccess", "disablecmd"
        If NOT userHasAccess(Username, cmdAccess) Then Exit Sub
        If UBound(cmd) > 0 Then
            Dsp Origin, ChangeAccess(cmd, False), Username, vbCyan
        Else
            Dsp Origin, "Proper usage: " &BotVars.Trigger&cmd(0)& " <command>", Username, vbOrange
        End If
    End Select
End Sub

Private Function ChangeAccess(Args, Usable)
    If IsCommand(BotVars.Trigger & Args(1)).Name = "" Then
        ChangeAccess = "Error:  Command (" &Args(1)& ") not found!"
        Exit Function
    End If

    Dim cmd, Rank
    Set cmd = OpenCommand(Args(1))

    If NOT Usable Then
        cmd.IsEnabled = False
        ChangeAccess = "Command:  (" &Args(1)& ") has been disabled."
    Else
        cmd.IsEnabled = True
        If IsNumeric(Args(2)) Then
            Rank = cInt(Args(2))
            If Rank < Lowest Then Rank = Lowest
            If Rank > Highest Then Rank = Highest
            cmd.RequiredRank = Rank
            ChangeAccess = "Set Access:  " &Args(1)& " <" &Rank& ">"
        Else
            cmd.RequiredFlags = Args(2)
            ChangeAccess = "Set Flags:  " &Args(1)& " <" &Rank& ">"
        End If
    End If
    cmd.Save
    Set cmd = Nothing        
End Function

Private Function userHasAccess(User, required)
    userHasAccess = False

    If User = BotVars.Username Then
        VetoThisMessage
        userHasAccess = True
    Else
        Dim A, F
        GetStdDBEntry User, A, F
        If IsNumeric(required) Then
            If A >= cInt(required) Then
                userHasAccess = True
            End If
        ElseIf LCase(required)=LCase(User) Then
            userHasAccess = True
        ElseIf InStr(1, F, required, 1)>0 Then
            userHasAccess = True
        End If
    End If
End Function