Not sure about that script, but here is a simple example of how it might look using the MetaScript Toolbox and TokenMod.
This will approximate this use case you previously detailed:
When checkbox A is checked, Marker A appears on the token.
When checkbox A is unchecked and Value A is lower than or equal to X, no marker.
When checkbox A is unchecked and Value A is great than X but lower than Y, then it's marker B.
When checkbox A is unchecked and Value A is greater than or equal to Y, then it's marker C.
First, this will assume that the checkbox you are utilizing is available to you (not all of them are). Some checkboxes represent attributes that are only available to sheet-processes (not scripts). If checkboxA is available to scripts, this will work. If it isn't, then no script will work.
{&if @(selected|checkboxA[0]) = 1}
!token-mod --set statusmarkers|MarkerA|-MarkerB|-MarkerC
{&else}
{&if @(selected|ValueA[0]) <= X}
!token-mod --set statusmarkers|-MarkerA|-MarkerB|-MarkerC
{&elseif @(selected|ValueA) > X && @(selected|ValueA) < Y}
!token-mod --set statusmarkers|-MarkerA|MarkerB|-MarkerC
{&else}
!token-mod --set statusmarkers|-MarkerA|-MarkerB|MarkerC
{&end}
{&end}
(The above written on separate lines for readability, and because that's how we'll use it later in this message. To run independently of the further work I will do, below, this would need to be on a single line.)
Now... the problem with the above approach is that it requires you to trigger it in some way. That is, it isn't silently monitoring the checkbox and reacting to every change. We can work around this -- which I'll do, below. But first, consider the alternative (a dedicated script that would monitor the checkbox):
Even if you had a dedicated script that could monitor the checkbox, you'd still have a problem in that the way Roll20 structures (and emits) their events... a script won't catch all changes to the checkbox (for instance, if the change to the checkbox was triggered by another script that change will not register). If you don't use another script to make character sheet changes, you might be OK.
So you're really in the business of finding the solution that can best satisfy what you are trying to do. With that said, back to the metascript solution...
If you want to broaden the command to check all player tokens (running the above command series), you can use SelectManager criteria, ZeroFrame batching, and utilize 2 abilities. I will assume that the abilities will be on a character named "MuleCharacter." The first ability can have any name (I'll call mine InitiateMarkerCheck). The second ability I'm calling MarkerCheck; this name and the name of the character it resides on appear in the first ability text, so if you change either, you will have to update the command line accordingly.
Here is InitiateMarkerCheck:
!forselected %(MuleCharacter.MarkerCheck) {&select *, +pc}
That will select all player character tokens on the board and run the command that is in MarkerCheck.
Here is MarkerCheck:
!{{
{&if @(selected|checkboxA[0]) = 1}
!token-mod --set statusmarkers|MarkerA|-MarkerB|-MarkerC
{&else}
{&if @(selected|ValueA[0]) <= X}
!token-mod --set statusmarkers|-MarkerA|-MarkerB|-MarkerC
{&elseif @(selected|ValueA) > X && @(selected|ValueA) < Y}
!token-mod --set statusmarkers|-MarkerA|MarkerB|-MarkerC
{&else}
!token-mod --set statusmarkers|-MarkerA|-MarkerB|MarkerC
{&end}
{&end}
}}
You can see how the MarkerCheck command could be expanded to incorporate more checks. In fact, since it's happening at this level, you'd have easier control than having a script hard-coded to checking specific values.
In any case, this will work to run. How to trigger it automatically? You could use The Aaron's "OnMyTurn" script with a combination of abilities on combat token/characters... although I did suggest to him the possibility of putting together an "OnEveryTurn" script, which would be a much easier setup for you: a single character with a single ability, and changing the Turn Tracker would cause the command to run. In that case, the "OnEveryTurn" command line would be the text of the "InitiateMarkerCheck" ability.
Watch for that from him, if you want to go this route (you can do the rest of the prep, building the conditionals, etc., so you're ready when it's available).