You can implement this, or custom analyses in general, in SimBiology either by creating a custom task on SimBiology desktop as you've suggested or by using a MATLAB script. I would suggest using a MATLAB script at least initially because it will be easier to debug your code.
To help start with this, you can configure a task and then check out the MATLAB/SimBiology code behind that task in SImBiology. This could serve as a starting point for your custom analysis. You can see the code by clicking on Task Code -> View Task Code on any built-in task on task editor. Please see below.
For example, to run a simple simulation, the programmatic workflow that you can run directly via a MATLAB script could look something like the following (you can run this example too since i'm using a shipped project):
project = sbioloadproject('AntibacterialPKPD','m1');
model = project.m1
settings = getconfigset(model);
settings.StopTime = 336;
dose = getdose(model, '500 mg tid')
simdata = sbiosimulate(model, settings, dose);
Does this help?