I have following MaxScript:
-- V-Ray Scene Validation Tool for ALL3D
-- Version: 0.5
-- Author: Kirtan Patel
-- Developer: Valkya Creations Pvt. Ltd.
-- Description: This utility will check current scene for ALL3D V-Ray Standards
/******************************************************************************/

macroScript ALL3DVRaySceneValidator
    category:"ALL3D"
    buttonText:"ALL3D Scene Validator"
    toolTip:"V-Ray Scene Validation Tool for ALL3D"
    icon:#("ALL3DVRaySceneValidator", 1)
(
    -- Check if scene is empty or not
    fn checkGeometries =
    (
        if geometry.count == 0 then
        (
            return FALSE
        )
        else
        (
            return TRUE
        )
    )
    
    -- Check Assets' Path
    fn checkAssetsPath =
    (
        ATSOps.refresh()
        global missingAssets = #()
        global incorrectPathAssets = #()
        global missingAssetsPath = ""
        for i = 1 to (AssetManager.GetNumAssets()) do
        (
            global AUIO = AssetManager.GetAssetByIndex i
            global AType = AUIO.GetType()
            global assetPath = AUIO.GetFileName()
            --format "Asset %: %\n" i assetPath
            
            local assetStatus = ATSOps.GetFileSystemStatus assetPath
            
            if (findItem assetStatus #Missing) then
            (
                append missingAssets i
                format "Asset % is %\n" assetPath assetStatus
                append missingAssetsPath (assetPath + "\n")
            )
            else if (not matchpattern assetPath pattern:"..\\VrayTextures\\*" ignorecase:FALSE) then
            (
                append incorrectPathAssets i
            )
        )
    )

    -- Check Assets
    fn checkAssets =
    (
        format "Checking assets...\n"
        ATSOps.refresh()
        checkAssetsPath()
        
        if missingAssets.count > 0 then
        (
            messageBox ("Following assets are missing:\n" + missingAssetsPath) title:"Assets Missing Warning" icon:#warning
            return FALSE
        )
        
        if incorrectPathAssets.count > 0 then
        (
            local changePaths = querybox "Do you want to change the paths of all assets to ..\\VrayTextures\\?" title:"Assets Path Confirmation"
            if changePaths then
            (
                if ATSOps.Visible == false then
                (
                    ATSOps.Visible = true
                )
                actionMan.executeAction -841213575 "2"
                local newPath = "..\\VrayTextures\\"
                ATSOps.SetPathOnSelection newPath
                ATSOps.refresh()
                checkAssetsPath()
            )
        )

        format "V-Ray scene validation complete.\n"
    )

    -- Append 3ds Max File Name To Materials Name
    fn appendMaxFileNameToMaterialsName =
    (
        local fileName = getFilenameFile maxFileName
        local fileNamePrefix = dotNetObject "System.Text.RegularExpressions.Regex" (fileName + "_*")
        local numberPrefix = dotNetObject "System.Text.RegularExpressions.Regex" ("#*_")
        for m in scenematerials do
        (
            format "Material: %\n" m.name
            if not fileNamePrefix.IsMatch(m.name) then
            (
                if numberPrefix.IsMatch(m.name) then
                (
                    local underscore = findString m.name "_"
                    m.name = fileName + "_" + (replace m.name 1 underscore "")
                    format "\tchanged to %\n" m.name
                ) else (
                    m.name = fileName + "_" + m.name
                    format "\tchanged to %\n" m.name
                )
                format "Material name did not included file name prefix.\n"
            ) else (
                format "Material name already includes file name prefix.\n"
            )
        )
        checkAssets()
    )

    -- Check Materials
    fn checkMaterials =
    (
        local unsupportedMaterials = #("Standardmaterial", "PhysicalMaterial", "Standard", "PBRMetalRough", "DoubleSided", "PBRSpecGloss", "InkNPaint", "MatteShadow", "XRef_Material", "TopBottom", "MorpherMaterial")
        local sceneMaterials = for obj in objects collect #(obj.material, obj.name)
        unsupportedMessage = ""
        for mat in sceneMaterials do (
            if findItem unsupportedMaterials (classOf mat[1] as string) != 0 then (
                unsupportedMessage += "\n" + mat[1].name + " (" + mat[1].category + ") on " + mat[2]
            )
        )
        if unsupportedMessage != "" then (
            messageBox ("Following materials are not supported:" + unsupportedMessage) title:"Materials Not Supported" icon:#warning
        ) else (
            messageBox "All materials are supported by V-Ray Renderer." title:"Supported Materials" icon:#information
            appendMaxFileNameToMaterialsName()
        )
    )

    -- Check Group and Placement
    fn productPlacement = (
        local sceneGroups = for o in objects where isGroupHead o and o.parent == undefined collect o
        local allGeometries = for o in objects where (superclassof o == GeometryClass or classOf o == VRayFur or classOf o == VRayLight) and not isGroupMember o collect o
        if sceneGroups.count != 1 or allGeometries.count != 0 then (
            local fileName = getFilenameFile maxFileName
            group (allGeometries + sceneGroups) name:fileName
        )
        select (for o in objects where isGroupHead o and o.parent == undefined collect o)[1]
        rollout askUser "Place Group" (
            radioButtons rb_placement labels:#("Floor", "Ceiling", "Wall")
            button btn_okay "Okay"
            on btn_okay pressed do (
                local theGroup = (for o in objects where isGroupHead o and o.parent == undefined collect o)[1]
                case rb_placement.state of (
                    1: theGroup.pivot = [theGroup.center.x, theGroup.center.y, theGroup.min.z]
                    2: theGroup.pivot = [theGroup.center.x, theGroup.center.y, theGroup.max.z]
                    3: theGroup.pivot = [theGroup.center.x, theGroup.max.y, theGroup.center.z]
                )
                theGroup.pos = [0,0,0]
                objs = for o in geometry where (isKindOf o GeometryClass and canConvertTo o Editable_Poly) collect o
                For items in objs do (
                    items.pivot = [0, 0, 0]
                )
                clearSelection()
                checkMaterials()
                destroyDialog askUser
            )
        )
        createDialog askUser
    )

    -- Append 3ds Max File Name To Objects Name
    fn appendMaxFileNameToObjectsName =
    (
        local fileName = getFilenameFile maxFileName
        local fileNamePrefix = dotNetObject "System.Text.RegularExpressions.Regex" (fileName + "_*")
        local numberPrefix = dotNetObject "System.Text.RegularExpressions.Regex" ("[#-_]*")

        -- Delete VRayPlane
        for sceneObject in objects where classOf sceneObject == VRayPlane do
        (
            format "Deleting VRayPlane object: %\n" sceneObject.name
            delete sceneObject
        )

        for obj in objects where (classOf obj == VRayFur or classOf obj == VRayLight or superclassof obj == GeometryClass) do
        (
            format "Object name: %\n" obj.name
            if not fileNamePrefix.IsMatch(obj.name) then
            (
                local underscorePos = findString obj.name "_"
                local dashPos = findString obj.name "-"
                local delimiterPos = if underscorePos != undefined then underscorePos else dashPos

                if delimiterPos != undefined then
                (
                    obj.name = fileName + "_" + (substring obj.name (delimiterPos + 1) (obj.name.count - delimiterPos))
                    format "\tchanged to %\n" obj.name
                ) 
                else 
                (
                    obj.name = fileName + "_" + obj.name
                    format "\tchanged to %\n" obj.name
                )
            ) 
            else 
            (
                format "Object name already includes file name prefix.\n"
            )
        )

        productPlacement()
    )

    if checkGeometries() then
    (
        appendMaxFileNameToObjectsName()
    )
    else
    (
        format "Current scene is empty.\n"
        messageBox ("Current scene does not contain any geometries.") title:"ALL3D Scene Validator" icon:#warning
    )
)

--

Right now, it runs all function at single click.
Instead, I want to to break them individually.
Like, when user clicks on the main icon in toolbar, it opens a dialog box with all individual buttons for each function. And it runs that particular function only when user clicks on that button. Also, all buttons are deactivated by default except first one. When user click first button and if the function runs successfully without error, then only second button gets activated. And when second function runs successfully, then only third button gets activated, so on and so forth.