WM_COMMAND が cpu使用率取得モジュール内の
await time に 割り込んでいるのかもしれません。
下のスクリプトなら多分大丈夫です。
#include "user32.as"
#include "gdi32.as"
#module GetCPUPer
#uselib "pdh.dll"
#func PdhOpenQuery "PdhOpenQuery" int,int,var
#func PdhAddCounter "PdhAddCounterA" int,var,int,var
#func PdhCollectQueryData "PdhCollectQueryData" int
#func PdhGetFormattedCounterValue "PdhGetFormattedCounterValue" int,int,int,var
#func PdhCloseQuery "PdhCloseQuery" int
#func PdhBrowseCounters "PdhBrowseCountersA" var
#deffunc InitQuery
dim FmtValue,4 : cpu = 0f
PdhOpenQuery 0,0,hQuery
s="\\Processor(_Total)\\% Processor Time"
PdhAddCounter hQuery, s,0,hCounter : return
#deffunc ExitQuery onexit
if hQuery!0{PdhCloseQuery hQuery}:return
#defcfunc UpDateCollectQueryData
PdhCollectQueryData hQuery
PdhGetFormattedCounterValue hCounter,0x200,NULL,FmtValue
dupptr cpu,varptr(FmtValue)+8,8,3 : return cpu
#global
#module
#deffunc CreateTab int p1, int p2, int p3, int p4
winobj "systabcontrol32", "", , $52000000 | p4, p1, p2 : hTab = objinfo(stat, 2)
GetStockObject 17 : sendmsg hTab, $30,stat:TabID=p3
if TabID=0{TabID=1}dim rect, 4:return hTab
#deffunc InsertTab str p2
pszText=p2:tcitem=1,0,0,varptr(pszText)
sendmsg hTab, $1307, TabItem, varptr(tcitem)
GetClientRect hTab,varptr(rect)
sendmsg hTab, $1328, , varptr(rect)
bgscr TabID + TabItem, rect.2 - rect.0, rect.3 - rect.1, 2, rect.0, rect.1
SetWindowLong hwnd,-16,$40000000
SetParent hwnd, hTab : TabItem++ : return
#deffunc ChangeTab
gsel wID + TabID, -1
sendmsg hTab, $130B
wID=stat : gsel wID + TabID, 1 : return
#global
#enum WID_MAIN = 0
#enum WID_CPU
#enum WID_CHILD
onexit *exit
screen WID_MAIN,400,300 : hwnd_main = hwnd
oncmd gosub *notify, $4E
oncmd gosub *timer , 0x113
syscolor 15 : boxf : pos 50, 50
CreateTab 300, 200, WID_CHILD : hTabControl = stat
InsertTab "AAA":InsertTab "BBB":gsel WID_CHILD,1
SetTimer hwnd_main , 0,1000,0
InitQuery
stop
*exit:KillTimer hwnd,0 :end
*notify:dupptr nmhdr, lparam, 12:if nmhdr.0=hTabControl&nmhdr.2=-551{ChangeTab}return
*timer:gsel WID_CHILD:color:boxf:color 255:pos 0,0:mes UpDateCollectQueryData():return