Take a look at this part:
Code:
local bars = CreateFrame("Frame", nil, self)
bars:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", -2, 37)
bars:SetSize(160/count, 3)
local i = count
for index = 1, count do
bars[i] = createStatusbar(bars, texture, nil, 14, (portraits and 160 or width)/count-5, 1, 1, 1, 1)
The green part sets the size of the frame that will hold holy power/soul shard/runes.
The blue part will set the size of each bar within the above frame. (looking at the createStatusbar function, the 4th parameter is bar height and the 5th parameter is bar width)
That should help you finish off your layout.